Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/web/html/element/bdo/index.md
6532 views
---
title: '<bdo>: The Bidirectional Text Override element' slug: Web/HTML/Element/bdo page-type: html-element browser-compat: html.elements.bdo
---

{{HTMLSidebar}}

The <bdo> HTML element overrides the current directionality of text, so that the text within is rendered in a different direction.

{{EmbedInteractiveExample("pages/tabbed/bdo.html", "tabbed-standard")}}

The text's characters are drawn from the starting point in the given direction; the individual characters' orientation is not affected (so characters don't get drawn backward, for example).

Attributes

This element's attributes include the global attributes.

  • dir

    • : The direction in which text should be rendered in this element's contents. Possible values are:

      • ltr: Indicates that the text should go in a left-to-right direction.

      • rtl: Indicates that the text should go in a right-to-left direction.

Examples

<!-- Switch text direction --> <p>This text will go left to right.</p> <p><bdo dir="rtl">This text will go right to left.</bdo></p>

Result

{{EmbedLiveSample('Examples')}}

Notes

The HTML 4 specification did not specify events for this element; they were added in XHTML. This is most likely an oversight.

Technical summary

Content categories Flow content, phrasing content, palpable content.
Permitted content Phrasing content.
Tag omission {{no_tag_omission}}
Permitted parents Any element that accepts phrasing content.
Implicit ARIA role No corresponding role
Permitted ARIA roles Any
DOM interface {{domxref("HTMLElement")}} Up to Gecko 1.9.2 (Firefox 4) inclusive, Firefox implements the HTMLSpanElement interface for this element.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • Related HTML element: {{HTMLElement("bdi")}}