CSS :lang Selector


Example

Select and style every <p> element with a lang attribute value equal to "it" (Italian):

p:lang(it) {
    background: yellow;
}

Try it yourself »

Definition and Usage

The :lang() selector is used to select elements with a lang attribute with the specified value.

Note: The lang attribute value is most often a two-letter language code, like lang="fr" (for French), or two language codes combined, like lang="fr-ca" (for Canadian French).

Version: CSS2


Browser Support

The numbers in the table specifies the first browser version that fully supports the selector.

Selector
:lang() 4.0 8.0 2.0 3.1 9.6

Note: For :lang() to work in IE8, a <!DOCTYPE> must be declared.


CSS Syntax

:lang(languagecode) {
    css declarations;
} Demo



Color Picker

colorpicker