CSS :dir() Selector Reference
The CSS :dir() pseudo-class matches elements according to their text direction.
Updated 2026-08-07
Syntax and example
Use :dir(ltr) or :dir(rtl) when styling must follow the direction calculated by the document language and directionality rules.
CSS
:dir(rtl) {
text-align: right;
}