Global dir Attribute - HTML CSS HTML Global Attribute

HTML CSS examples for HTML Global Attribute:dir

Description

The dir attribute specifies the text direction of the element's content.

Attribute Values

Value Description
ltr Default. Left-to-right text direction
rtl Right-to-left text direction
auto Let the browser figure out the text direction, based on the content

A paragraph with a right-to-left direction:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p dir="rtl">Write this text right-to-left!</p>

</body><!--   w  w w.  j  a v  a 2 s .com-->
</html>

Related Tutorials