BDO Element | BDO Object

DHTML, HTML, & CSS

BDO Element | BDO Object


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

HTML Syntax

<BDO
    DIR=ltr|rtl
    ID=value
    LANG=language
    TITLE=text
    event=script
>

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.

The BDO element is an inline element and requires a closing tag.

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

Members

Example

Sample Code

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


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.