:dir()

A pseudo-class that targets elements based on the directionality of the text within them (e.g., left-to-right or right-to-left).

/* Usage Example */
blockquote:dir(rtl) {
  /* Specific styling for right-to-left blockquotes */
  border-right: 5px solid #ccc;
  padding-right: 20px;
}
Newly available Since 2023 87% global usage

Since 2023 this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

120+
49+
16.4+
120+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC