CSS2 » Properties » direction

Version: Level 2

Compability: IE5+

Syntax:
direction : ltr | rtl
rtl
The rtl value sets the direction to be right-to-left.
ltr
The ltr value sets the direction to be left-to-right. This is the default.

The direction property allows you to choose the direction that the text will flow (i.e., left-to-right or right-to-left). For example, this can be applied to embedded text, quotes, and strings. It can also be applied to the order of the columns in a table or to dictate the placement of text when using the text-align property. This property is inherited.

The default for the flow of text is left to the right, such as for English or Spanish. However, certain languages, such as Chinese and Hebrew, flow from the right to the left.
 
If you wish to apply the direction property to an inline text, you must set the unicode-bidi property either to the bidi-override or embed values.

Examples

Code:
blockquote.eng { direction: ltr; }
blockquote.heb { direction: rtl; }
Language(s): CSS2
Code:
<blockquote style="direction: rtl; unicode-bidi: bidi-override;">
ABC DEF GHI JKL MNO PQR STU VWX YZ
</blockquote>
Output:
ABC DEF GHI JKL MNO PQR STU VWX YZ
Language(s): CSS2

See Also: