CSS unicode-bidi Property
Description
The unicode-bidi CSS property controls how the Unicode Bidirectional Algorithm is applied to an element’s inline content, letting authors influence the directional embedding and reordering of text that mixes left-to-right and right-to-left scripts. It operates at the inline formatting level: when applied, it can create a new directional context for the element’s contents, force an overriding direction for characters that would otherwise follow surrounding text, or prevent an element’s internal directionality from affecting its surroundings. In short, unicode-bidi is the tool that tells the browser how strictly to treat the element as its own bidi unit versus letting it participate in the bidi resolution of the surrounding text.
Because it manipulates embedding levels and overrides inside the Unicode bidi algorithm, the property can change only the visual ordering of characters and runs — it does not reorder DOM nodes or alter the logical content. That distinction matters for selection, cursor movement, and accessibility: screen readers and the document source keep the original logical order even when the rendering is visually rearranged. Also, unicode-bidi acts on inline-level boxes (text runs and inline elements); its effects are realized during the bidi resolution pass that determines embedding levels, neutrals, and reordering for display, which means it can influence how punctuation, numbers, and adjacent neutral characters adopt surrounding directions.
In practical authoring, unicode-bidi is normally used alongside a base direction declaration — for example, set the element’s base direction to LTR or RTL via direction and then scope or override bidi processing with unicode-bidi. For cases where you need to fully isolate an element’s directionality from the rest of the document (so its internal ordering never affects adjacent text), consider the more recent scoping mechanisms such as isolation or applying logical layout adjustments via writing-mode; each approach has slightly different implications for layout, inheritance, and how inline runs are resolved. Finally, use unicode-bidi sparingly and test interactive behaviors (selection, caret movement, copy/paste), since visual-only reordering can surprise users and assistive technologies if not combined with appropriate semantic markup.
Definition
- Initial value
- normal
- Applies to
- All elements
- Inherited
- No
- Computed value
- As specified
- Animatable
- No
- JavaScript syntax
- object.style.unicodeBidi
Interactive Demo
Syntax
unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext
Values
- normalElement does not open an additional level of embedding. For inline elements, implicit reordering works across element boundaries.
- embedElement opens an additional level of embedding. The value of the direction property specifies the embedding level. Reordering is implicit inside the element.
- isolateThis keyword indicates that the element's container directionality should be calculated without considering the content of this element.
- bidi-overrideSame as the embed value, except that, inside the element, reordering is strictly in sequence according to the direction property. This value overrides the implicit bidirectional algorithm.
- isolate-overrideThis keyword applies the isolation behavior of the isolate keyword to the surrounding content and the override behavior of the bidi-override keyword to the inner content.
- plaintextThis keyword makes the elements directionality calculated without considering its parent bidirectional state or the value of the direction property. The directionality is calculated using the P2 and P3 rules of the Unicode Bidirectional Algorithm.
- inherit
Example
Browser Support
The following information will show you the current browser support for the CSS unicode-bidi property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
