HTML <bdo> tag
The <bdo> tag stands for Bi-Directional Override. It defines a part of text which can override the text direction regardless of the surrounding text.
Type: Inline Element
Example of <bdo> tag
<bdo dir="rtl"> NOITCERID </bdo>
Supported Browsers
| Tag | Chrome | Internet Explorer | Firefox | Safari | Opera Mini |
|---|---|---|---|---|---|
| <bdo> | Yes | Yes | Yes | Yes | Yes |
Full code example
<!DOCTYPE html> <html> <head> </head> <body> <bdo dir="ltr"> DIRECTION </bdo> <br> <bdo dir="rtl"> DIRECTION </bdo> </body> </html>
Output on the browser
DIRECTION
DIRECTION
Attribute Values
| Attribute | Value | Note |
|---|---|---|
| dir | ltr | It tells that the text direction is left-to-right (LTR). Default value. |
| rtl | It tells that the text direction is right-to-left (RTL). |
Without the dir attribute, the <bdo> tag cannot be defined by HTML alone. Be sure to add the dir attribute with an appropriate value.
Use <bdi> tag, only when the default direction is known whereas use <bdo> tag when the text direction is unknown and want to force in a specific direction.
More reference
You can use CSS direction property to change the text direction.
<!DOCTYPE html> <html> <head> <style> bdo { direction: rtl; } </style> </head> <body> <bdo>SEMAJ</bdo> </body> </html>
Output on the browser
SEMAJ
