Horje
What is HTML dir Attribute

Definition and Usage

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


Browser Support

Syntax

<element dir="ltr|rtl|auto">

Attribute Values

Value Description
ltr Default. Left-to-right text direction
rtl Right-to-left text direction
auto Let the browser figure out the text direction, based on the content (only recommended if the text direction is unknown)

How to add A paragraph with a right-to-left direction - HTML dir Attribute

See Example.
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

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

</body>
</html>

Output should be:

How to add A paragraph with a right-to-left direction - HTML dir Attribute




html dir attribute

Related Articles
What is HTML accesskey Attribute HTML Global Attributes
What is HTML class Attribute HTML Global Attributes
What is HTML contenteditable Attribute HTML Global Attributes
What is HTML data-* Attributes HTML Global Attributes
What is HTML dir Attribute HTML Global Attributes
What is HTML draggable Attribute HTML Global Attributes
What is HTML enterkeyhint Attribute HTML Global Attributes
What is HTML hidden Attribute HTML Global Attributes
What is HTML id Attribute HTML Global Attributes
What is HTML inert Attribute HTML Global Attributes
What is HTML inputmode Attribute HTML Global Attributes
What is HTML lang Attribute HTML Global Attributes
What is HTML popover Attribute HTML Global Attributes
What is HTML spellcheck Attribute HTML Global Attributes
What is HTML style Attribute HTML Global Attributes
What is HTML tabindex Attribute HTML Global Attributes
What is HTML title Attribute HTML Global Attributes
What is HTML translate Attribute HTML Global Attributes
What are the HTML Global Attributes HTML Global Attributes

Single Articles
How to add A paragraph with a right-to-left direction - HTML dir AttributeHTML Global Attributes

Read Full:
HTML Global Attributes
Type:
Develop
Category:
Web Tutorial
Sub Category:
HTML Global Attributes
Uploaded by:
Admin
Views:
22


Reffered: https://www.w3schools.com/tags/att_global_dir.asp