Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML dir Attribute

HTML dir Attribute

HTML Global Attributes HTML Global Attributes

Example

A paragraph with a right-to-left text direction:

<

bdo

dir

=

"

rtl

"

Right-to-left text direction!

bdo

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the dir attribute


Definition and Usage

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


Differences between HTML 4.01 and HTML5

In HTML5, the dir attribute can be used on any HTML element (it will validate any HTML element, but it may not be useful).

In HTML 4.01, the dir attribute cannot be used on: ,
, , ,


,