HTML <bdo> Tag

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

The dir attribute is required option for the <bdo> tag. It defines the direction within the <bdo> tag. The dir attribute can take one of two values:

Syntax

The content of the <bdo> element is being written between the opening (<bdo>) and the closing (</bdo>) tags.

Example

<!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

Attributes

Attribute Value Description
dir ltr
rtl
Defines the direction of the text from left to right or from right to left.

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

Browser support





Related articles