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

CSS Syntax

:lang(languagecode) {
  css declarations;
} Demo


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.