CSS direction property
Example
Set the text direction to "right-to-left":
div
{
direction:
rtl
;
unicode-bidi:
bidi-override
;
}
Try it »
Property definition and usage
The direction property specifies the text direction / writing direction.
| Default value: | ltr |
|---|---|
| Inherited: | yes |
| Version: | CSS2 |
| JavaScript syntax: | object.style.direction="rtl" |
Browser support
The numbers in the table indicate the first browser version that supports this property.
A number immediately before -webkit-, -ms-, or -moz- indicates the first browser version that supports that prefixed property.
| property | |||||
|---|---|---|---|---|---|
| direction | 2.0 | 5.5 | 1.0 | 1.3 | 9.2 |
Attribute values
| Value | Description |
|---|---|
| ltr | Default. Text direction is left-to-right. |
| rtl | Text direction is right-to-left. |
| inherit | Specifies that the direction property should be inherited from the parent element. |
Related Articles
CSS Tutorial: CSS Text