CSS :lang() Pseudo-class

Definition and Usage

CSS :lang() Pseudo-classes are used to select elements with specified lang elements with attribute values.

Note:lang The attribute value is usually a double-letter language code, such as lang="fr" (indicating French), or a combination of two language codes, such as lang="fr-ca" (indicating Canadian French).

Example

Set styles for any <p> element with a lang attribute value of "it" (Italian):

p:lang(it) {
  background-color: yellow;
  font-style: italic;

Try It Yourself

CSS Syntax

:lang(languagecode) {
  css declarations;

Technical Details

Version: CSS2

Browser Support

The numbers in the table indicate the first browser version to fully support the pseudo-class.

Chrome Edge Firefox Safari Opera
4.0 8.0 2.0 3.1 9.6