HTML dir Attribute

 

Definition and Usage

The dir attribute is a global attribute. It specifies the direction of element’s content.

Values :

  1. rtl : Value specifies right to left direction.
  2. ltr : Value specifies left to right direction.
  3. auto : Value specifies that the Direction will be set according the browser.

Example :

<p dir="rtl"> Direction of the text is Right to Left </p>

<p dir="ltr"> Direction of the text is Left to Right </p>

<p dir="auto"> Text direction is set according the browser </p>
Result

Direction of the text is Right to Left


Direction of the text is Left to Right


Text direction is set according the browser

 

Next ❯

❮ Previous

Here are a few tutorials for you to read next:

If you find this tutorial helpful, then please Subscribe to our YouTube Channel for video tutorials, and share this article on social media.

Was this post helpful?
Let us know if you liked the post. That’s the only way we can improve.
Yes0
No0
Powered by Helpful

Leave a Comment

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