dir (HTML attribute)
Example
Here, the direction is set to right-to-left:
<p>The sequence was reversed as <bdo dir="rtl">1-2-3-4-5</bdo></p>
Description
The bdo
element on its own doesn’t do an awful lot—it’s basically useless without
the dir attribute, a required attribute, to set the
direction in which text should render, regardless of the order of text in
the parent containers.
Value
There are only two possible values for
dir: "ltr" or
"rtl".
Compatibility
| IE | 5.5 | Full |
|---|---|---|
| 6.0 | Full | |
| 7.0 | Full | |
| Firefox | 1.0 | Full |
| 1.5 | Full | |
| 2.0 | Full | |
| Safari | 1.3 | None |
| 2.0 | None | |
| 3.0 | Full | |
| Opera | 9.2 | Full |
| 9.5 | Full |
With the exception of
Safari 1.3 and 2, all browsers reverse the text properly, including nested
bdo elements where the outer bdo
specifies one direction, and the inner bdo specifies
the opposite direction.
User-contributed notes
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

