CSS :langSelectors
Complete CSS Selector Reference Manual
Example
The style for selecting each <p> element whose lang attribute value equals "it(Italian)":
p:lang(it)
{
background:yellow;
}
{
background:yellow;
}
Try it Yourself »
Definition and Usage
:lang adds styles to elements with a specified lang attribute starting value.
Note:The value can be a whole word, like lang="en", or use a hyphen (-), such as lang="en-us".
Browser Support
The number in the table indicates the first browser version number that supports the property.
| Selectors | |||||
|---|---|---|---|---|---|
| :lang() | 4.0 | 8.0 | 2.0 | 3.1 | 9.6 |
Note:For :lang to work in IE8, it must be declared.<!DOCTYPE>。
other extensions