By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

CSS Direction Property

The direction property of css is used to control the reading direction of text.

Edited: 2015-12-03 13:32

The CSS direction property controls the direction of text.

The default direction is left-to-right, but some languages are written right-to-left. Changing the direction of the text can be useful if your page contains multiple languages.

Can be used together with unicode-bidi property.

Possible Values

  • ltr (Default) [Left-to-right direction]
  • rtl [Right-to-left direction]
body {
  direction: rtl;

Inherited? YES!

Text direction example

In this example we will control the direction of the text by setting the direction property to rtl, and the unicode-bidi property to bidi-override:

<div style="direction:rtl;unicode-bidi:bidi-override;">This text is written from the right-to-left.</div>

Which will look like:

This text is written from the right-to-left.