Skip to content

HTML <bdo> Tag

The HTML <bdo> tag ("bidirectional override") sets the direction of text output from right to left. It is used primarily with languages where reading occurs from right to left (e.g., Arabic).

The dir attribute is required for the <bdo> tag. It defines the text direction and can have one of two values: ltr or rtl.

You should not use RTL words and phrases without markup, as this can cause display issues. To isolate bidirectional text and avoid such problems, use the <bdi> element.

HTML5 explicitly supports event attributes on all elements, including <bdo>.

Syntax

The <bdo> tag comes in pairs. The content is written between the opening (<bdo>) and closing (</bdo>) tags.

Example of the HTML <bdo> text:

HTML tag <bdo>

html
<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
  </head>
  <body>
    <p>Text from left to right </p>
    <p>
      <bdo dir="rtl">And this one, from right to left</bdo>.
    </p>
  </body>
</html>

Result

bdo example

Attributes

AttributeValueDescription
dirltr | rtlDefines the direction of the text from left to right or from right to left.

The <bdo> tag also supports Global Attributes and Event Attributes.

How to style an HTML tag <bdo>

You can apply standard CSS properties to the <bdo> element. For example:

css
bdo {
  color: #333;
  font-weight: bold;
  background-color: #f0f0f0;
}

Practice

What is the purpose of the HTML <bdo> tag?

Dual-run preview — compare with live Symfony routes.