HTML - <bdo> Tag



HTML <bdo> tag stands for Bi-Directional Override. This element overrides the current text directionality, causing the text to be shown in a new direction. HTML <bdo> tag includes global attributes, one of which is dir, which is the direction in which the text should be rendered in this element’s contents.

Syntax

<bdo dir="..">...</bdo>

Attribute

HTML bdo tag supports Global and Event attributes of HTML. Some specific attributes are accepted as well which are listed bellow.

Attribute Values Description
dir ltr
rtl
auto
It defines the the text direction on the websites.

Examples of HTML bdo Tag

In the bellow examples we will see the usage of bdo element, will style bdo element using internal css as well. Each exmaple was shown for different purpose.

Defining bdo element with dir Attribute

In the following example, we are creating an HTML document to see the workings of the <bdo> tag with HTML dir Attribute.

<!DOCTYPE html>
<html>
<body>
   <p>
      Bellow paragraph will go right-to-left.
   </p>
   <p>
      <bdo dir="rtl">
         Tutorialspoint: Simply Easy Learning
      </bdo>
   </p>
 </body>
</html>

Styling bdo element with Internal CSS

Let's look at the following example, where we are creating an HTML document and using the <bdo> tag and its attribute, as well as the CSS properties to style the bdo’s content, as follows −

<!DOCTYPE html>
<html>
<head>
   <style>
      bdo {
         color: green;
         font-style: italic;
      }
   </style>
</head>
<body>
   <p>
      Default Direction of the Context
   </p>
   <p>
      <bdo>
         Tutorialspoint: Simply Easy Learning
      </bdo>
   </p>
   <p>
      Bellow paragraph will go right-to-left.
   </p>
   <p>
      <bdo dir="rtl">
         Tutorialspoint: Simply Easy Learning
      </bdo>
   </p>
 </body>
</html>

Supported Browsers

Tag Chrome Edge Firefox Safari Opera
bdo Yes Yes Yes Yes Yes
html_tags_reference.htm
Advertisements