Horje
HTML dir Attribute

Definition and Usage

The dir attribute specifies the text direction of the element's content.

The dir attribute can have the following values:

  • ltr - means left-to-right text direction
  • rtl - means right to left text direction
  • auto - lets the user agent decide the text direction, based on the content (only recommended if the text direction is unknown)

Applies to

The dir attribute is a Global Attribute, and can be used on any HTML element.

Element Attribute
All HTML elements dir

Browser Support


How to add A paragraph with a right-to-left direction

Write this text right-to-left!
index.html
Example: TRY
<!DOCTYPE html>
<html>
<body>

<p dir="rtl">Write this text right-to-left!</p>

</body>
</html>





html dir attribute

Type:
Develop
Category:
Web Tutorial
Sub Category:
HTML Attribute
Uploaded by:
Admin


Read Article
https://develop.horje.com/learn/1434/reference