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: 
inherit
Takes the value of this property from the computed style of the parent element.
ltr
Default. Left to right.
rtl
Right to left.
Default: ltr.

Example HTML code 1:

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

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content