Home  >  Article  >  Web Front-end  >  The role of the dir attribute in html tags.

The role of the dir attribute in html tags.

黄舟
黄舟Original
2016-12-22 14:52:591748browse

The dir attribute in the html tag is considered an international attribute. You can use the dir attribute to specify the display direction of text in the browser.

When you need to specify the directionality of the entire document or most of the document, you should use the dir attribute in the element instead of the element for two reasons:

dir attribute has two values:

ltr: left to right, default value.

rtl: From right to left, some languages, such as Hebrew or Arabic, or ancient Chinese classical Chinese, are read from right to left.

Usage examples are as follows:

Define documents that are read from left to right:

1

Define documents that are read from right to left:

1


That's it Regarding the role of the dir attribute in the html tag, please pay attention to the PHP Chinese website (www.php.cn) for more related content!


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