You are here: Reference > CSS > properties > direction

direction property

Browser support:
Specifies the text direction.
The direction property affects the horizontal rendering order only, the left and right sides of the margin, border and padding are not swapped.
JavaScript page for this property: direction. You can find other example(s) there.

Possible values:

 One of the following values: 
Takes the value of this property from the computed style of the parent element.
Default. Left to right.
Right to left.
Default: ltr.

Example HTML code 1:

This example illustrates the use of the direction property:
        .ltr {
            font-size: 20pt;
            direction: ltr;
        .rtl {
            font-size: 20pt;
            direction: rtl;
    <p class="ltr">
        0 1 2 3 4 5 6 7 8 9
    <p class="rtl">
        0 1 2 3 4 5 6 7 8 9
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content