CSS Selector Level 2 » Lang pseudo-class

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.
There will be wildcard (*) matching selectors in CSS4.

# 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 a blue color.

Try example in CodePen

# Browser support

Platform Chrome Firefox Safari Edge Internet Explorer Opera
Desktop Yes (1) Yes (1) Yes (3.1) Yes (12) Yes (8) Yes (8)
Mobile Yes (1) Yes (1) Yes (1) Yes (12) Yes (8) Yes (2)

Please wait a moment, the comments start loading now...
explorermozillachromesafariopera info external