CKTIS / HTML
HTML element: bdo
The bidirectional-override element forces character display direction when the intended presentation must replace the Unicode algorithm’s result.
Version: WHATWG HTML Living Standard; index snapshot date recorded separately
Syntax
<bdo dir="rtl">ABC-123</bdo>bdo requires the dir attribute; it must have the valid value ltr or rtl, and the automatic state is not allowed on this element.
An override through bdo changes ordering throughout its contents, whereas bdi only isolates unknown direction; user names normally need isolation.
Source text is not reversed, so copying and DOM APIs see the original order; overrides can mislead readers and should reflect a genuine typographic need.
The example observes direction and unicodeBidi through getComputedStyle(), then uses textContent to confirm the unchanged source string.
Examples
<!doctype html>
<meta charset="utf-8">
<p id="serial" dir="ltr">Visual override: <bdo id="code" dir="rtl">ABC-123</bdo></p>
<output id="result"></output>
<script>
const code = document.querySelector("#code");
const style = getComputedStyle(code);
document.querySelector("#result").textContent = `attr=${code.dir}; direction=${style.direction}; bidi=${style.unicodeBidi}; text=${code.textContent}; parent=${code.parentElement.dir}`;
</script>
Result
attr=rtl; direction=rtl; bidi=isolate-override; text=ABC-123; parent=ltr
The result verifies a forced RTL override inside an LTR parent; it does not assess font shaping or assistive pronunciation.