LAST UPDATED: JUNE 2, 2020
HTML bdo Tag
HTML <bdo>
tag is used to change the current direction of the text on a webpage. If you have users from different parts of the world using your website, and submitting content in their own language, you can set a default direction for the user input using the <bdo>
tag, but this can change the meaning of the text sometimes or render the text unreadable, so use it carefully.
-
The term <bdo>
stands for the bi-directional override.
-
Every Language has a default direction for the readability of text; left-to-right or right-to-left but when you mix them on a webpage, the browser can get confused, how to show the text. To overcome this problem you can use the <bdo>
tag.
-
This element is mainly used to display a variety of languages such as Arabic and Hebrew, which are read from right to left, alongside the English language on a webpage.
-
You can specify the text direction by setting the dir
attribute to either RTL(right-to-left) or LTR(left-to-right).
-
Also, this is an inline element.
HTML <bdo>
Tag - Syntax and Usage
The <bdo>
element requires the start(opening) tag and end(closing) tag.
Required syntax for the same is given below:
<bdo> SOME TEXT </bdo>
HTML <bdo>
Tag Basic Example
Below we have a basic example for understanding the <bdo>
tag:
HTML <bdo>
Tag Attributes
This element has one attribute, which is dir
and it also supports Global attributes and Event attributes.
The dir attribute is used to specify the direction of the text in the <bdo>
tag.
The dir attribute can have the following values:
Default CSS Style for HTML <bdo>
tag
bdo {
unicode-bidi: bidi-override;
}
Browser Support for HTML <bdo>
tag
Following browsers support this attribute:
-
Firefox 1+
-
Google Chrome 1+
-
Internet Explorer 5+
-
Apple Safari 1+
-
Opera 7+