The HTML <bdo> tag
The HTML <bdo> (bidirectional override) element forces the writing direction of its text, set by the required dir attribute (ltr or rtl). Use it to override the natural direction of characters; use <bdi> to merely isolate unknown-direction text.
Overview
The <bdo> (bidirectional override) element explicitly overrides the bidirectional algorithm, rendering its content in the direction set by its required dir attribute — ltr (left-to-right) or rtl (right-to-left).
It is rarely needed, but useful when you must force characters to display in a particular order regardless of their natural direction. Unlike <bdi>, which isolates text so its direction does not affect its surroundings, <bdo> actively sets the direction of its own contents.
Syntax
<bdo dir="rtl">This text is overridden.</bdo>
Attributes
The <bdo> element supports the following attributes, in addition to the global attributes available to every HTML element.
| Attribute | Value | Description |
|---|---|---|
dir |
ltr rtl auto |
Sets the text direction of content. |
Example
<p>Normal, and <bdo dir="rtl">reversed by bdo</bdo>.</p>
Best practices
Frequently asked questions
What is the bdo element for?
dir attribute.What is the difference between bdo and bdi?
<bdo> forces a specific direction; <bdi> isolates text so its direction does not affect its surroundings.Is the dir attribute required on bdo?
<bdo> must have a dir of ltr or rtl to define the override.