HTML and CSS Reference
In-Depth Information
THE LANGUAGE PSEUDO-CLASS
The language pseudo-class, :lang() , allows you to match an element
based on its language.
For example, lets say you want a specific link on your site to have a di " erent
background color, depending on that page's language:
:lang(en) > a#flag {
background-image: url(english.gif);
}
:lang(fr) > a#flag {
background-image: url(french.gif);
}
The selectors will match that particular link if the page's language is either
equal to “en” or “fr” or if it starts with “en” or “fr” and is immediately followed
by an “-”.
Notes on browser support
Not surprisingly, the only version of Internet Explorer that supports this
selector is 8. All other major browsers support the language pseudo-
selector.
5. CSS 3 Pseudo-classes
:TARGET
When you're using links with fragment identifiers (for example, http://
www.smashingmagazine.com/2009/08/02/bauhaus-ninety-years-of-
inspiration/#comments, where “ #comments ” is the fragment identifier), you
can style the target by using the :target pseudo-class.
 
 
 
Search WWH ::




Custom Search