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).
Syntax of the <bdo> tag
The content of the <bdo> element is being written between the opening (<bdo>) and the closing (</bdo>) tags.
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:
- ltr – direction of the text from left to right.
- rtl – direction of the text from right to left.
<html> <head> <title>Title of the documnet</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>
The <bdo> tag supports also the global attributes.