Home  >  Article  >  Web Front-end  >  HTML5中对dir属性的解释与规定

HTML5中对dir属性的解释与规定

PHP中文网
PHP中文网Original
2016-05-17 09:10:122005browse

HTML5中对dir属性的解释与规定

ltr:从左到有。
rtl:从右到左。
auto:根据文本内容自动决定,不准确,不建议使用,除非万不得已。

元素的dir属性用于定义元素的文字排版方向。
可设置如下几个值:
bdi元素没有设置dir属性时,和设置auto效果一致。
根元素没有设置dir属性时,和设置成ltr效果一致。
元素没有设置dir属性,而其父元素设置了dir属性时,将参考父元素的dir属性。
相比与CSS方法,HTML5标准更鼓励大家通过设置dir属性来达到排版效果(例如搜索引擎可能不会抓取css文件)。

ngines).

以上就是HTML5中对dir属性的解释与规定的内容,更多相关内容请关注PHP中文网(www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn