The dir Attribute
The dir attribute specifies the direction of an element's text.
The two supported values are ltr and rtl.
- ltr is for left-to-right text.
- rtl is for right-to-left text.
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
</head>
<body>
<p dir="rtl">This is right-to-left</p>
<p dir="ltr">This is left-to-right</p>
</body>
</html>
Home
HTML CSS Book
HTML
HTML CSS Book
HTML
HTML5 Global Attributes:
- The accesskey Attribute
- The class Attribute
- The contenteditable Attribute
- The contextmenu Attribute
- The dir Attribute
- The draggable Attribute
- The dropzone Attribute
- The hidden Attribute
- The id Attribute
- The lang Attribute
- The spellcheck Attribute
- The style Attribute
- The tabindex Attribute
- The title Attribute
Related: