home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Book HomeHTML & XHTML: The Definitive GuideSearch this book

3.10. The <bdo> Tag

As we've mentioned earlier, the authors of the HTML 4 standard have made a concerted effort to include standard ways web agents (browsers) are supposed to treat and display the many different human languages and dialects. Accordingly, the HTML 4 standard and its progeny XHTML contain the universal dir and lang attributes that let you explicitly advise the browser that the whole document or specific tagged segments within it are in a particular language. These language-related attributes, then, may affect some display characteristics; for example, the dir attribute tells the browser to write the words across the display from either left to right (dir=ltr), as for most Western languages, or right to left (dir=rtl), as for many Asian languages. Section 3.6.1.1, "The dir attribute", Section 3.6.1.2, "The lang attribute"

The various Unicode and ISO standards for language encoding and display may conflict with your best intentions. In particular, the contents of some other documents, such as a MIME-encoded file, already may be properly formatted and your document may misadvise the browser to undo that encoding. Hence, the HTML 4 and XHTML standards have the <bdo> tag. With it, you override any current and inherited dir specifications. And with the tag's required dir attribute, you definitively specify the direction in which the tag's contents should be displayed.

For example, Figure 3-4 shows how Internet Explorer Version 5 handles the following HTML fragment containing a <bdo> redirection:

<bdo dir=rtl>This would be readable if in Chinese, perhaps.</bdo>
Back to the Western way of reading and writing.
Figure 3-4

Figure 3-4. Tricks with <bdo> redirected text flow

Admittedly, the effects of the <bdo> tag are a bit esoteric and the opportunities to use it currently are rare, particularly considering that the second most popular browser doesn't yet support it.

<bdo>

Function:

Overrides bidirectional algorithms for content display

Attributes:

CLASS

DIR

ID

LANG

STYLE

TITLE

End tag:

</bdo>; never omitted

Contains:

text

Used in:

body_content



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.