HTML Tags

HTML <bdo> Tag

The <bdo> tag stands for Bi-Directional Override and is used to override the current text direction of its content.
It’s mainly helpful for displaying text in languages that are written from right to left (RTL), such as Arabic or Hebrew, or for testing direction behavior.
You must use the dir attribute to specify the direction - either ltr (left-to-right) or rtl (right-to-left).

Syntax

html

<bdo dir="rtl">Text to display in reverse direction</bdo>

Attributes

AttributeDescription
dirRequired. Specifies the text direction: ltr (left-to-right) or rtl (right-to-left).
classAdds one or more class names for CSS styling.
idAssigns a unique identifier to the element.
styleDefines inline CSS styles.
titleDisplays additional information on hover.

Example

html

<!DOCTYPE html>
<html>
<head>
  <title>BDO Tag Example</title>
  <style>
    bdo {
      background-color: #f0f0f0;
      padding: 5px 8px;
      border-radius: 5px;
      font-weight: bold;
    }
  </style>
</head>
<body>
  <h1>HTML <bdo> Tag Example</h1>

  <p>Normal text direction:</p>
  <p>Hello World!</p>

  <p>Text direction reversed using <code><bdo dir="rtl"></code>:</p>
  <p>
    <bdo dir="rtl" id="reverse-text" class="highlight" style="color:#29AB87;">Hello World!</bdo>
  </p>

  <p>
    Another example with <code>dir="ltr"</code> (default left to right):
    <bdo dir="ltr" title="Left to Right Direction">HTML5 & CSS3</bdo>
  </p>
</body>
</html>

Output

Browser Output

html

Use our TryIt Editor to see the output.

Browser Support

Chrome
Edge
Firefox
Safari
Opera
IE9+
YesYesYesYesYesYes

The <bdo dir="rtl"> element reverses the display direction of the text inside it.
“Hello World!” will appear from right to left instead of the default left-to-right.

Notes

  • The dir attribute is mandatory for the <bdo> tag to function.
  • Commonly used to override inherited text direction in multilingual websites.
  • It can be styled with CSS for visual clarity or emphasis.
  • Use <bdi> instead if you need the browser to automatically determine text direction.

Conclusion

The <bdo> tag is a powerful tool for controlling text direction manually, ensuring correct display of multilingual content.
It’s particularly useful in applications involving RTL languages or testing text rendering direction.