Little Web Hut
(Cascading Style Sheets) CSS 2.1 Reference

CSS Pseudo-class :lang( ) Selector

 

What is a CSS Pseudo-class :lang( ) Selector?

  • The :lang pseudo-class selector specifies elements that match the specified language. The language value is enclosed in parentheses immediately after :lang. For a match to occur, the specified language must equal the element's language or be a hyphen-separated sub string of the language. In the following example, the color property will be set to red for any <p> element that matches the language. The style is NOT applied to the third <p> element.
CSS Example:
  p:lang(en) {color: red;}
  <p lang="en">The red style has been applied to this element.</p>
  <p lang="en-au">The red style has been applied to this element.</p>
  <p lang="fr">The red style has not been applied to this element.</p>
Test It HTML StyleTest It XHTML StyleTest It HTML5 Style