Easy Tutorial
❮ Dom Obj Details Prop Node Attributes ❯

direction Attribute


Definition and Usage

The direction attribute sets or returns the text direction of an element.

Syntax

Set the direction attribute:

Return the direction attribute:

Value Description
ltr Default. Text flows from left to right.
rtl Text flows from right to left.
inherit The text direction is inherited from the parent element.

Browser Support

All major browsers support the direction attribute.

Note: IE7 and earlier versions do not support the "inherit" value. IE8 only supports "inherit" if !DOCTYPE is specified. IE9 supports "inherit".


Example

Set the text flow to right to left:


❮ Dom Obj Details Prop Node Attributes ❯