Many languages (including Latin alphabet based languages)
are written and rendered horizontally from left to right,
while some others (such as Arabic and Hebrew) are written and
rendered from right to left. When characters from both writing
systems are present, it is known as bi-directional text (also
known as BIDI.) Some character combinations in BIDI situations
are ambiguous with respect to the directionality of the content.
If the ambiguity is not made clear, it can be impossible for a
computer to render these character combinations in such a way
that the original meaning is conveyed. HTML has allowed for the
resolution of this problem by creating the BDO element. This
element is used to force the directionality of each character
within to the value of its DIR attribute, irrespective of the
characters' intrinsic directional properties. The BDO DIR attribute
specifies whether the override is left-to-right or right-to-left.
BIDI override is needed where absolute control over character
sequence order is required (such as mixed-language directionality
words) and use of the common attribute DIR on other elements
fails to produce proper bi-directional rendering. It is also useful
in dealing with short pieces of text in which the directionality
cannot be clearly resolved from the surrounding context.
On block-level elements, the DIR attribute indicates the base directionality
of the text in the block. If omitted it is inherited from the parent element.
The default directionality of the overall HTML document is left-to-right.
On inline elements, it makes the element start a new directional embedding
level. If omitted, the inline element does not start a new embedding level.
Values:ltr (Left to Right) | rtl (Right to Left)
In all HTML 4.x/XHTML 1.0 DTDs. Dropped in XHTML 1.1 in favor of XML:Lang attribute.
Specifies a string indicating the language/character set used in the BDO container.
Values: Any RFC 1766 value.
[Must begin with a letter ([A-Za-z]), followed by any number of characters in [A-Za-z0-9-_:.]
Does this look <bdodir="rtl">Backwards</bdo> to you?
Although the above example demonstrates the use of BDO by reversing
the direction of some English content (a rather cheap visual trick),
please remember that this is not its intended semantic purpose.
Opera 4-6.x (so far) only offers generalized support for BDO (only
class/id/style/event attributes.) It does not have any element-specific behaviors.
Netscape 6.0 only offered generalized support for BDO - it only supported
class/id/style/events, but did not offer any element-specific behavior. The
same thing could be said for any made-up element name. This changed in 6.1.