Hosting Solutions
mobile_logo Table of Contents


The HTML dir attribute specifies the direction that content is going in the element. It is usually used to insert foreign language content into a document with a language that is read in the opposite direction.

HTML Code Example

Make the content flow right-to-left. <p dir="rtl">Content in the element</p>

Possible Values

ltr - left to right. rtl - right to left. auto - automatically determine the direction.

JavaScript Interfacing

This attribute can be applied to an element using JavaScript, and its value may be changed at any time using JavaScript. element.dir = "rtl";


Core Attributes