方向(LTR/RTL):CSS方向和HTML方向属性之间有什么区别? [英] Direction (LTR/RTL): What's the difference between the CSS direction and HTML direction attribute?
问题描述
两者之间是否有任何区别
Is there any difference between
<body dir="rtl">
和
<body style="direction:rtl">
?
推荐答案
<body dir="rtl">
更合适:
http://www.w3.org/International/questions/qa-bidi-css -标记
由于方向性是文档结构的组成部分,因此应使用标记来设置文档或信息块的方向性,或标识文本中仅靠Unicode双向算法不足以实现所需方向性的位置. [...]因此,您应该在可用的时候使用专用的比迪烟标记.不要简单地将CSS样式附加到常规元素上以达到效果.
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的用户代理也将从这种方法中受益.
User-agents that ignore CSS will also benefit from this approach.
这篇关于方向(LTR/RTL):CSS方向和HTML方向属性之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!