The :Lang Pseudo-Class

The :lang pseudo-class allows you to define special rules for different languages. In the example below, :lang defines the quotation marks for <q> elements with lang="no":

HTML file: Displayed by browser:
<style>
q:lang(no) {
    quotes: "~" "~";
}
:lang(en) {
    font-style: italic;
}
</style>
<body>
<p>Some text <q lang="no">A quote in a paragraph</q> more text.</p>
<p>Some text <q lang="en">A quote in a paragraph</q> more text.</p>
</body>

Some text A quote in a paragraph more text.

Some text A quote in a paragraph more text.

Note: IE8 supports the :lang pseudo class only if a !DOCTYPE is specified.

Back button Table of Contents Next button