CSS :lang Selector

Complete CSS Reference Complete CSS Reference

Example

How to style <p> elements with attribute lang="it":

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

Try it yourself »

Definition and Usage

The :lang() selector styles all elements with the lang attribute set to a specified value.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The :lang() selector is supported in all major browsers.

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


CSS Version

The :lang() selector was first introduced in:

CSS 2


Complete CSS Reference Complete CSS Reference