Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS :lang() selector

CSS :lang selector

Complete CSS SelectorComplete CSS Selector Reference Manual

Example

Each

Style for elements whose lang attribute value equals "it (Italian)":

p:lang(it)

{

background:yellow;

}

Try it »


Definition and Usage

:lang adds styles to elements whose specified lang attribute begins with the given value.

Note: The value must be a whole word, either alone such as lang="en", or using a hyphen (-) as in lang="en-us".


Browser support

The numbers in the table indicate the first browser version that supports this property.

Selector
:lang() 4.0 8.0 2.0 3.1 9.6

Note: For :lang to work in IE8, a DOCTYPE must be declared.


Complete CSS SelectorComplete CSS Selector Reference Manual