HTML <bdo> Tag for Bi-Directional Override

 

ATTENTION: THIS PAGE IS Valid HTML 5 AND IS BEST VIEWED WITH HTML 5 - Please upgrade your browser or download one of the HTML 5 compatible browsers such as Mozilla Firefox, Chrome, Opera or IE 9 (March 14, 2011 or later). For more information see HTML 5 browsers.


If you find this helpful, please click the Google +1 Button to the left, if it is white, to make it turn blue or red. Thank you! (It also helps find this page again more easily.)


PDF mobile

The <bdo> Tag in HTML 5

The HTML <bdo> tag (bi-directional override) explicitly overrides the directionality property of the text within the bdo element. It is one of the formatting tags in HTML 5. The required dir attribute specifies the direction of the text.


<bdo> Tag Syntax

Rules for coding HTML bdo elements
<body>
   ...
   ... phrasing content expected ...
   <bdo dir="direction">... phrasing content ...</bdo>
   ...
</body>
Rules for coding HTML bdo elements

Make sure you understand the difference between a tag and element and are familiar with the definitions of namespace and other HTML terms.

  1. Code the bdo element where phrasing content is expected.
  2. Begin the bdo element with a starting <bdo> tag. The element name uses lower case letters and should be in the HTML namespace, which it will pick up automatically from the xmlns attribute on the <html> tag.
  3. Inside the starting <bdo> tag code the required dir attribute with the direction along with any HTML global attributes as appropriate.
  4. Inside the bdo element, between the starting <bdo> tag and the ending </bdo> tag, code the inner HTML phrasing content.
  5. End the bdo element with a matching </bdo> closing tag.
Content Model
Content of the bdo element

The content of the bdo element can include HTML comments, text content and only those HTML tags that can be used in phrasing content.


<bdo> Tag Attributes

Attributes of the <bdo> tag
global attributes In addition to the personal attributes of the <bdo> tag below, any of the common HTML attributes can also be coded.
dir="ltr"
dir="rtl"
directionality required

<bdo> Tag Examples

Examples of the bdo tag in HTML 5

Changes in HTML 5 - <bdo> Tag

What's new in HTML 5

The <bdo> tag is one of the new elements in HTML 5.

Differences between HTML 5 and earlier versions of HTML

The <bdo> tag did not exist in older versions of HTML.

The 2000-2010 Recommendations from the W3C HTML Working Group defined the HTML namespace for the names of all HTML element types, which now includes the bdo element name. In older (pre-2000) versions of HTML, element type names were not associated with a namespace.


Valid HTML 5