Can I use below code (html, css) to make my website compatible with RTL?

北城余情 提交于 2019-12-24 19:43:22

问题


I know that there is some standards from w3.org. However this is just a thought.

Instead of using "dir" in html and body tag, can I use below custom attribute to identify layout?

Actual: <html dir="rtl">

My: <html layout="rtl">

After identifying Layout from above Tag, Is that suggested to use below line of code in css?

Code:

html[layout="rtl"] .heading-main , .title, .content {
  direction: rtl !important;
  text-align: right !important;
}

So that, I can add desired css code to selected elements to make my react App compatible with Arabic language.

来源:https://stackoverflow.com/questions/50597254/can-i-use-below-code-html-css-to-make-my-website-compatible-with-rtl

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