CSS direction Property


Example

Set the text direction to "right-to-left":

div {
    direction: rtl;
}

Try it yourself »

Definition and Usage

The direction property specifies the text direction/writing direction.

Tip: Use this property together with the unicode-bidi property to set or return whether the text should be overridden to support multiple languages in the same document.

Default value: ltr
Inherited: yes
Animatable: no. Read about animatable
Version: CSS2
JavaScript syntax: object.style.direction="rtl" Try it


Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Property
direction  2.0 5.5 1.0 1.3 9.2


CSS Syntax

direction: ltr|rtl|initial|inherit;

Property Values

Value Description Play it
ltr The writing direction is left-to-right. This is default Play it »
rtl The writing direction is right-to-left Play it »
initial Sets this property to its default value. Read about initial Play it »
inherit Inherits this property from its parent element. Read about inherit


Related Pages

CSS tutorial: CSS Text

HTML DOM reference: direction property



Color Picker

colorpicker