HTML and CSS Reference
In-Depth Information
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 per-
mitted to ignore this property.
Examples:
*:lang(en) {direction: ltr;}
*:lang(ar) {direction: rtl;}