O'Reilly logo

CSS Pocket Reference, 4th Edition by Eric A. Meyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

direction

Values:

ltr | rtl

Initial value:

ltr

Applies to:

All elements

Inherited:

Yes

Computed value:

Same as declared value

Description:

Defines the base writing direction of blocks and the direction of embeddings and overrides for the unicode bidirectional algorithm. Furthermore, it changes the way a number of properties and layout decisions are handled, including but not limited to the placement of table cells in a table row and the layout algorithms for block boxes.

For a variety of reasons, authors are strongly encouraged to use the HTML attribute dir rather than the CSS property direction. User agents that do not support bidirectional text are permitted to ignore this property.

Examples:

*:lang(en) {direction: ltr;}
*:lang(ar) {direction: rtl;}

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required