CSS - direction


The direction indicates the writing direction to be used in the rendering of an element.

Possible Values

  • ltr − element will be rendered from left to right.

  • rtl − element will be rendered from right to left.

Applies to

All the HTML elements.

DOM Syntax

object.style.direction = "ltr";


Here is the example −


      <p style = "direction:rtl;">
         Right-to-left rendering direction - Example
      <p style = "direction:ltr;">
         Left-to-right rendering direction - Example

This will produce following result −