The lang pseudo-class will match the elements based on the document language. This could be set via the lang
HTML attribute, an HTTP
or <meta>
information.
# Syntax
Copy
:lang(language) {
/* declarations */
}
# Example
Copy
:lang(en) {
color: red;
}
:lang(de) {
color: blue;
}
While all elements with an English language will have a red color, the German language based text will have an blue color.
Try example in CodePen# Browser support
Platform
Chrome
Firefox
Safari
Edge
Internet Explorer
Opera
Desktop
Yes (1.0)
Yes (1.0)
Yes (3.1)
Yes (12.0)
Yes (8.0)
Yes (8.0)
Mobile
Yes (1.0)
Yes (1.0)
Yes (1.0)
Yes (12.0)
Yes (8.0)
Yes (2.0)
Please wait a moment, the comments start loading now...