HTML CSS examples for HTML Global Attribute:dir
The dir attribute specifies the text direction of the element's content.
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:
<!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>