HTML5 dir Property:
This property specifies the text direction of the element content.
Syntax structure:
<dir= "Ltr|rtl|auto">
Browser support:
(1). This property is supported by IE browser.
(2). This property is supported by Google Chrome.
(3). Firefox supports this property.
(4). This property is supported by the Safari browser.
(5). This property is supported by the Opera browser.
Differences between HTML4.01 and HTML5:
(1). In HTML5, the Dir property can be used with any HTML element (it validates any HTML element.) But not necessarily useful).
(2). HTML4.01, the Dir element cannot be used for: <base>, <br>, <frame>, <frameset>,
Property value:
Value |
Describe |
Ltr |
Default. Left-to-right text direction. |
Rtl |
Right-to-left text direction. |
Auto |
Let the browser determine the direction of the text based on the content. Recommended only if the text direction is unknown. |
code example:
<!DOCTYPE HTML><HTML><Head><MetaCharSet= "Utf-8"><Metaname= "Author"content= "http://www.51texiao.cn/" /><title>Ant Tribe</title><style>P{Color:Red;font-size:12px;}</style></Head><Body><Pdir= "RTL">Ant Tribe Softwhy.com</P></Body></HTML>
The original address is: http://www.51texiao.cn/HTML5jiaocheng/2015/0618/4619.html
The most original address is: http://www.softwhy.com/forum.php?mod=viewthread&tid=10037
HTML5 dir Property