CSS direction Property
Definition and Usage
The direction
property specifies the text direction/writing direction within
a block-level element.
Tip: Use this property together with the unicode-bidi property to set or return whether the text should be overridden to support multiple languages in the same document.
Default value: | ltr |
---|---|
Inherited: | yes |
Animatable: | no. Read about animatable |
Version: | CSS2 |
JavaScript syntax: | object.style.direction="rtl" Try it |
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
direction | 2.0 | 5.5 | 1.0 | 1.3 | 9.2 |
CSS Syntax
direction: ltr|rtl|initial|inherit;
Property Values
Value | Description | Demo |
---|---|---|
ltr | Text direction goes from left-to-right. This is default | Demo ❯ |
rtl | Text direction goes from right-to-left | Demo ❯ |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
Related Pages
CSS tutorial: CSS Text Alignment
HTML DOM reference: direction property