方向(LTR / RTL):CSS方向和HTML方向属性有什么区别?

前端之家收集整理的这篇文章主要介绍了方向(LTR / RTL):CSS方向和HTML方向属性有什么区别?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
那么这有什么区别呢?
<body dir="rtl">

和这个?:

<body style="direction:rtl">

解决方法

< body dir =“rtl”>根据W3C的建议更为合适:

http://www.w3.org/International/questions/qa-bidi-css-markup

Because directionality is an integral part of the document structure,markup should be used to set the directionality for a document or chunk of information,or to identify places in the text where the Unicode bidirectional algorithm alone is insufficient to achieve desired directionality. […] You should therefore use dedicated bidi markup whenever it is available. Do not simply attach CSS styling to a general element to achieve the effect.

忽略CSS的用户代理也将受益于此方法.

猜你在找的CSS相关文章