HTML and CSS Reference
In-Depth Information
Figure 8-5. The first-child pseudoclass in action
Finally, the CSS2 standard defines a new pseudoclass that lets you se-
lect an element based on its language. For instance, you might include
the
lang=fr
attribute in a
<div>
tag to instruct the browser that the divi-
sion contains French language text. The browser may specially treat the
text. Or, you may impose a specific style with the pseudoclass
:lang
. For
example:
div:lang(it) {font-family: Roman}
says that text in divisions of a document that contain the Italian lan-
guage should use the Roman font family. Appropriate, don't you think?
Notice that you specify the language in parentheses immediately after
the
lang
keyword. Use the same two-letter International Organization
for Standardization (ISO) standard code for the pseudoclass
:lang
as
8.3.4.4. Browser support of pseudoclasses
None of the popular browsers supports the
:lang
or
:focus
pseudoclass
yet. All the current popular browsers support the
:link, :active, :hov-