coderef

Layout direction overrideBaseline · Widely available

The unicode-bidi and direction CSS properties override the Unicode layout algorithm. They are intended for Document Type Definition (DTD) designers. For HTML documents, you should use the dir global HTML attribute and <bdo> HTML element instead.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jan 15, 2020. Widely available since Jul 15, 2022.

Browser support

DesktopChrome
1–47Not supported
48+Supportedsince Jan 20, 2016
Current: 155
Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154
Firefox
1–49Not supported
50+Supportedsince Nov 15, 2016
Current: 157
Safari
1–10.1Not supported
11+Supportedsince Sep 19, 2017
Current: 27
MobileChrome Android
18–47Not supported
48+Supportedsince Jan 26, 2016
Current: 155
Firefox Android
4–49Not supported
50+Supportedsince Nov 15, 2016
Current: 157
Safari iOS
1–10.3Not supported
11+Supportedsince Sep 19, 2017
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: direction.

Feature detection

CSS · check before using
@supports (direction: initial) {
  /* styles that rely on direction */
}

/* or in JavaScript */
if (CSS.supports("direction", "initial")) {
  // use it
}

Sub-features

Support for each part of the feature (10). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
direction212111841
direction.ltr212111841
direction.rtl212111841
unicode-bidi21211.31841
unicode-bidi.bidi-override21211.31841
unicode-bidi.embed21211.31841
unicode-bidi.isolate48795011485011
unicode-bidi.isolate-override48795011485011
unicode-bidi.normal21211.31841
unicode-bidi.plaintext48795011485011