: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
Globals: 94.09% of all users can use this feature, 94.09% fully supported, 0% partially supported
✓Supported
✗Not supported
Partial support
Prefixed
Behind a Flag