Horje
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
HTML accesskey Attribute HTML Global Attributes
HTML class Attribute HTML Global Attributes
HTML contenteditable Attribute HTML Global Attributes
HTML data-* Attributes HTML Global Attributes
HTML dir Attribute HTML Global Attributes
HTML draggable Attribute HTML Global Attributes
HTML enterkeyhint Attribute HTML Global Attributes
HTML hidden Attribute HTML Global Attributes
HTML id Attribute HTML Global Attributes
HTML inert Attribute HTML Global Attributes
HTML inputmode Attribute HTML Global Attributes
HTML lang Attribute HTML Global Attributes
HTML popover Attribute HTML Global Attributes
HTML spellcheck Attribute HTML Global Attributes
HTML style Attribute HTML Global Attributes
HTML tabindex Attribute HTML Global Attributes
HTML title Attribute HTML Global Attributes
HTML translate Attribute HTML Global Attributes
HTML Global Attributes HTML Global Attributes

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

Type:
Develop
Category:
Web Tutorial
Sub Category:
HTML Global Attributes
Uploaded by:
Admin


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