direction (CSS property)

Spec
Inherited Initial Version
Yes ltr CSS2
Browser support (more…)
IE5.5+ FF1+ SA1.3+ OP9.2+ CH2+
Full Full Full Full Full

Syntax

direction: { ltr | rtl | inherit } ;

Description

This property specifies the following:

  • the base writing direction of blocks
  • the direction of embeddings and overrides—see unicode-bidi—for the Unicode bidirectional algorithm
  • the direction of table column layout
  • the direction of horizontal overflow
  • the position of an incomplete last line in a block, when the text-align property has the value justify

For the direction property to affect content reordering in inline elements, the unicode-bidi property must be set to embed or override.

The CSS2.1 specification emphasizes that this property should normally be used only by DTD designers. In particular, authors, web designers, and users shouldn’t override it.

Example

This style rule causes the columns in tables belonging to the "arabic" class to be laid out from right to left:

table.arabic {
  direction: rtl;
}

Value

ltr
sets a left-to-right direction
rtl
sets a right-to-left direction

Compatibility

Internet Explorer Firefox Safari Opera Chrome
5.5 6.0 7.0 8.0 1.0 1.5 2.0 3.0 3.5 1.3 2.0 3.1 4.0 9.2 9.5 10.0 2.0
Full Full Full Full Full Full Full Full Full Full Full Full Full Full Full Full Full

User-contributed notes

There are no comments yet.

Related Products