dir tag or Attribute in html

The dir attribute allows you to indicate to the browser the direction in which the text should flow; left to right or right to left. When you want to indicate the directionality of a whole document (or the majority of the document), it should be used with the element rather than the element for two reasons: Its use on the element has better support in browsers, and it will apply to the header elements as well as those in the body. The dir attribute can also be used on elements within the body of the document if you want to change the direction of a small portion of the document.

The dir attribute can take one of two values:-
1) ltr Left to right (the default value)
2) rtl Right to left (for languages such as Hebrew or Arabic that are read right to left)

Author: Ramesh Saini

Leave a Reply

Your email address will not be published. Required fields are marked *