Style direction Property
The Style object
Definition and Usage
The direction property sets or returns the text direction of an element.
Syntax
Set the direction property:
Object.style.direction="ltr|rtl|inherit"
Return the direction property:
Object.style.direction
| Value | Description |
|---|---|
| ltr | Default. The text flows from left to right. |
| rtl | The text flows from right to left. |
| inherit | The text direction is inherited from the parent element. |
Browser support





All major browsers support the direction property.
**Note:** IE7 and earlier versions do not support the "inherit" value. IE8 supports "inherit" only if a !DOCTYPE is specified. IE9 supports "inherit".
Example
Example
Set the text flow to right-to-left:
This is some text.
Try it »
The Style object