Html direction attribute is not working

2019-07-17 09:16发布

In my webpage I set the locale to arabic and want to change the direction of the content display from right to left by using <html dir = "rtl">. But it is not displaying all the divisions of webpage from right to left some are getting reflected and some are not.

Is there any suggestion to change all the content display from right to left of a web page?

4条回答
Anthone
2楼-- · 2019-07-17 09:58

This is old question, but i hope it'll help someone, If direction:rtl; didn't work then try to override bidi in your css

unicode-bidi: bidi-override !important;
direction: unset !important;
text-align:right;
查看更多
Animai°情兽
3楼-- · 2019-07-17 10:00

HTML dir="rtl" or CSS direction:rtl is to control BiDi for the language script.

But in most cases where mixing different scripts you need to add also HTML align="right" or CSS text-align:right which is used to control visual display alignment.

查看更多
闹够了就滚
4楼-- · 2019-07-17 10:10

The following code

body {
   direction: rtl;
}

will work like sugar.

查看更多
成全新的幸福
5楼-- · 2019-07-17 10:18

You can use CSS instead:

html {
    direction: rtl;
}

Have a look at this page from W3 about your issue.

查看更多
登录 后发表回答