direction
Specifies the direction of text flow.
Sample Code
div.test { direction: ltr;}
div.test1 { direction: rtl;}
Available Values
| Value | Description |
|---|---|
| ltr | Specifies text flow direction from left to right. This 'ltr' is the initial value for Japanese and English locales. |
| rtl | Specifies text flow direction from right to left. When specifying this value, you also need to set the 'unicode-bidi' property to 'bidi-override'. |
Browser Preview
<p style="direction: ltr">This is a p element with 'direction: <span style="color: #f00">ltr</span>' specified.</p>
<p style="direction: rtl; unicode-bidi: bidi-override;">This is a p element with 'direction: <span style="color: #f00">rtl</span>' and 'unicode-bidi: bidi-override' specified.</p>
Browser Support
Desktop
1 and earlier ×Supported in all versions
8 ○
7 ○
6 ○
8 and earlier ×Mobile
Android Browser
4.4+ ○
3 and earlier ×Same support as desktop
Same support as desktop
※ Version data based on MDN.
Overview
Specifies the direction of text flow.
To make text flow from right to left, you not only need to set the value to 'rtl', but you also need to set the 'unicode-bidi' property to 'bidi-override'.
If you find any errors or copyright issues, please contact us.