Little Web Hut

CSS 2.1 Reference: direction Property

CSS direction Property
selector {direction: value;}
  • value is specified by using one of the following keywords: ltr, rtl, or inherit.

The direction property is used to specify whether the text direction is ltr (left to right) or rtl (right to left).

This property is specified by using a keyword according to the syntax shown above.

CSS Example: The direction properties are set using both ltr and rtl.
  #tst1 {direction: ltr;}
  #tst2 {direction: rtl;}
Test It HTML StyleTest It XHTML StyleTest It HTML5 Style

  • ltr - Left to right text direction.
  • rtl - Right to left text direction.
  • inherit - The inherit keyword is used to specify that the value for this property should be taken from the parent element. If inherit is used with the root element, then the initial value for this property will be used.
Applies To Applies to all elements. However, for the direction property to affect an inline element, the element's unicode-bidi property needs to be set to embed or override.
Inherited Yes
Initial Value ltr

direction Property Examples
Test It HTML StyleTest It HTML StyleTest It HTML5 StyleThe direction properties are set using both ltr and rtl.