Skip to main content

Featured to Learn

CSS direction Property

Example

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

p.rtl {
  direction: rtl;
}

Definition and Usage

The direction property specifies the text direction/writing direction within a block-level element.

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.
Version: CSS2
JavaScript syntax: object.style.direction="rtl"

  • Inherited : "Inherited = yes" means that it can takes (inherit) it's value from it's parent element.
  • object - object in javascript means the element on which direction is applied.
  • Animatable - "Animatable = no" means that it cannot be animated with CSS @keyframes.

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 Demo
ltr Text direction goes from left-to-right. This is default
rtl Text direction goes from right-to-left
initial Sets this property to its default value.  
inherit Inherits this property from its parent element.

Comments

Most Reads