CSS direction property
CSS direction Property
Description
The direction property indicates the writing direction to use when rendering an element.
Possible Values
- ltr – The element will be rendered from left to right.
-
rtl – The element will be rendered from right to left.
Applies to
All HTML elements.
DOM Syntax
object.style.direction = "ltr";
Example
Here is an example –
<html>
<head>
</head>
<body>
<p style = "direction:rtl;">
Right-to-left rendering direction - Example
</p>
<p style = "direction:ltr;">
Left-to-right rendering direction - Example
</p>
</body>
</html>
This will produce the following result −