VOOZH about

URL: https://www.geeksforgeeks.org/html/html-bdo-tag/

⇱ HTML bdo Tag - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML bdo Tag

Last Updated : 11 Jul, 2025

The <bdo> (Bidirectional Override) tag in HTML is used to override text directionality, explicitly setting text direction to left-to-right (LTR) or right-to-left (RTL).

  • It can make text go from left to right or right to left.
  • This is helpful for languages like Arabic or Hebrew.
  • It ensures text displays correctly in different languages.

Syntax:

<bdo dir="ltr">This text will be displayed left-to-right.</bdo>
<bdo dir="rtl"> This text will be displayed right-to-left. </bdo>

Output:

GeeksforGeeks
GeeksforGeeks
  • The <bdo> tag with dir="ltr" forces the text "GeeksforGeeks" to display from left to right, ensuring proper alignment in left-to-right contexts.
  • The <bdo> tag with dir="rtl" forces the same text to display from right to left, which is useful for languages like Arabic or Hebrew.

Attributes:

This element contains dir attributes which are used to specify the direction of text written inside the <bdo> element. The dir attribute contains two values which are listed below: 

  • rtl: Text direction is from right to left (reverses the text).
  • ltr: Text direction is from left to right (default text direction).

More Examples of the <q> Tag

Reversing Text Direction

  • The <bdo> tag with dir="rtl" reverses the text direction to display it from right to left.
  • Useful for testing or correcting text direction in multilingual content.

Displaying Bi-Directional Content

  • The <bdo> tag isolates a section of text and overrides its directionality to ensure proper formatting.
  • Ideal for embedding languages like Arabic or Hebrew within a left-to-right document.

Best Practices for Using the <bdo> Tag

  • Use the <bdo> tag only when you need to override text direction explicitly.
  • Ensure the dir attribute is correctly set to either ltr or rtl for proper direction.
Comment
Article Tags: