Set the text direction of a <p> element to "right-to-left":
The direction property sets or returns the text direction (reading order) of an element's content.
The direction property is supported in all major browsers.
Return the direction property:
Set the direction property:
Value | Description |
---|---|
ltr | Text flows from left to right. This is default |
rtl | Text flows from right to left |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Default Value: | ltr |
---|---|
Return Value: | A String, representing the text direction of an element |
CSS Version | CSS2 |
Return the text direction of a <p> element:
CSS tutorial: CSS Text
CSS reference: direction property
HTML reference: HTML dir Attribute
HTML DOM reference: HTML DOM dir Property