:dir() CSS pseudo-classExternal Link

BaselineWidely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since June 2026.

Matches elements based on their directionality. :dir(ltr) matches elements which are Left-to-Right. :dir(rtl) matches elements which are Right-to-Left.

IE

Edge

Firefox

Chrome

Safari

Safari iOS

Opera Mini

Chrome Android

Android Browser

Samsung Internet

12-1040.01%
2-160.03%
4-901.98%
105-1190.16%
17-480%
91-1193.84%
3.1-16.30.12%
3.2-16.30.9%
4-240.03%
5.5-100%
120-1494.75%
49-1512.46%
120-14919.19%
16.4-26.30.98%
16.4-26.34.16%
2.1-4.4.40%
25-290.28%
110.22%
1500%
1520.47%
1500.04%
26.40.09%
26.40.62%
all0%
15044.75%
1500.14%
300.99%
153-1550%
151-1530.01%
26.5-TP1.15%
26.57.04%
Globals:88.78%
Partial support
Prefixed
Behind a browser flagsBehind a Flag