Description

The word BDO stands for Bi-Directional Override.

HTML element <bdo> is used to override the current text direction of a text by specifying the direction using the dir attribute.

The below table summarizes its usage.

Usage Details
Placement It is displayed as an Inline element.
Contents It can contain Inline elements and text.
Tags Both opening and closing tags are required.
Versions HTML 4, 4.01, and 5

Syntax

The dire attribute is required with one of the below values.

  • Attribute dir="ltr" to set the direction from left to right
  • Attribute dir="rtl" to set the direction from right to left
<bdo dir="ltr|rtl">...</bdo>

Examples

In the below example, the third student's name is in Arabic which is read from right to left. which is different from the first two student names.

<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
    <h1>HTML Element - bdo</h1>
    <p>The alphabets A-B-C-D-E-F can be revered using this element as <bdo dir="rtl">A-B-C-D-E-F</bdo></p>
</body>
</html>

Attributes

The following table shows the list of supported and unsupported attributes for the <b> tag.

Attribute Type Details
Tag-Specific Attributes The tag <bdo> supports the below tag-specific attributes.
  • dir which can have the value ltr or rtl
Global Attributes Like all other HTML tags, the tag <bdo> supports the HTML Global Attributes.
Event Attributes The tag <bdo> also supports the HTML Event Attributes.

Browser Compatibility

The tag <bdo> is supported in all modern browsers.

  • Google Chrome 1+
  • Internet Explorer or Edge 5+
  • Firefox 1+
  • Apple Safari 1+
  • Opera 7+

Related Links