The dir
attribute specifies the direction of an element's text.
The two supported values are ltr
for left-to-right text
and rtl
for right-to-left text.
<element dir="ltr|rtl|auto">
dir |
Yes | Yes | Yes | Yes | Yes |
The following code shows how to use
dir
attribute.
<!DOCTYPE HTML>
<html>
<body>
<p dir="rtl">This is right-to-left</p>
<p dir="ltr">This is left-to-right</p>
</body>
</html>