Html direction attribute is not working

拟墨画扇 提交于 2019-12-12 18:14:36

问题


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?


回答1:


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;



回答2:


The following code

body {
   direction: rtl;
}

will work like sugar.




回答3:


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:


You can use CSS instead:

html {
    direction: rtl;
}

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



来源:https://stackoverflow.com/questions/19997153/html-direction-attribute-is-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!