CSS Selector Pseudo class :dir()

The :dir CSS pseudo-class matches elements based on the directionality of the text contained in it. Pseudo-class :dir() is not equivalent of using the [dir=…] attribute selector. The latter matches a value of the dir and doesn't match when no attribute is set, even if in that case the element inherits the value of its parent. On the other hand, :dir() will match the value calculated by the UA, being inherited or the auto value.



Editor's draft

Status in Chromium


In development (tracking bug)

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

  • Shipped/Shipping
  • No signal
  • No signal
  • No signals


Last updated on 2020-10-15