3 out of 3 rated this helpful - Rate this topic

bdo element | bdo object

[This documentation is preliminary and is subject to change.]

Allows authors to disable the bidirectional algorithm for selected fragments of text.

HTML 4.01 Specification, Section 8.2.4

Standards information

HTML information

Closing Tagrequired
CSS Displayinline

DOM Information

Inheritance Hierarchy

 Node
    bdo
 Element
    bdo

Remarks

The BDO element can be used to control the reading order of a block of text.

The Unicode bidirectional algorithm automatically reverses embedded character sequences according to their inherent direction. For example, the base direction of an English document is left-to-right (ltr). If portions of a paragraph within this document contain a language with the right-to-left (rtl) reading order, you can reverse the direction of that language by applying the bidirectional algorithm.

The bidirectional algorithm and the DIR attribute generally suffice for embedded direction changes. However, incorrect presentations can occur when you expose formatted text to the bidirectional algorithm. For example, a paragraph containing English and Hebrew that is formatted for e-mail could be incorrectly inverted by the bidirectional algorithm. Because the reading order of the Hebrew text was inverted once for the e-mail, exposing it to the bidirectional algorithm would invert the words a second time.

The BDO element turns off the algorithm and controls the reading order. The DIR attribute is required when you use the BDO element.

This element is available in HTML and script as of Microsoft Internet Explorer 5.

Examples

This example uses the BDO element to correct the reading order of a block of text.

The following string includes text written in the left-to-right order of the English language and the right-to-left order of Hebrew: This fragment is in English, WERBEH NI SI TNEMGARF SIHT.

Assume that the right-to-left text (WERBEH NI SI TNEMGARF SIHT.) already has been inverted, so that it displays in the correct direction. If you subsequently apply the Unicode bidirectional to the text, the text inverts a second time and incorrectly displays as left-to-right instead of right-to-left.

The solution is to override the bidirectional algorithm and put the block of text in the correct reading order inside a BDO element whose DIR attribute is set to ltr.


<BDO DIR="ltr">This fragment is in English, 
    WERBEH NI SI TNEMGARF SIHT.</BDO>

See also

direction

 

 

Build date: 3/8/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ