Search w3schools.com:

SHARE THIS PAGE

CSS Reference

CSS Reference CSS Selectors CSS Reference Aural CSS Web Safe Fonts CSS Units CSS Colors CSS Color Values CSS Color Names CSS Color HEX CSS3 Browser Support

CSS Properties

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.

Default value: ltr
Inherited: yes
Version: CSS2
JavaScript syntax: object.style.direction="rtl"


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The direction property is supported in all major browsers.

Note: The value "inherit" is not supported in IE7 and earlier. IE8 requires a !DOCTYPE. IE9 supports "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 »
inherit Specifies that the value of the direction property should be inherited from the parent element


Related Pages

CSS tutorial: CSS Text

HTML DOM reference: direction property



Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]