: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).
Syntax
/* Usage Example */
blockquote:dir(rtl) {
/* Specific styling for right-to-left blockquotes */
border-right: 5px solid #ccc;
padding-right: 20px;
}
:dir() Browser support
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+