lang (:lang)
The :lang CSS pseudo-class matches elements based on the language the element is determined to be in. In HTML, the language is determined by a combination of the lang attribute, the element, and possibly by information from the protocol (such as HTTP headers). For other document types there may be other document methods for determining the language.
Acceptable language-code strings are specified in the HTML 4.0 specification.
Example
<!DOCTYPE html> <html> <head> <style> : lang( en) > Q { quotes: '\201C' '\201D' '\2018' '\2019'; }: lang( fr) > Q { quotes: '« ' ' »'; }: lang( de) > Q { quotes: '»' '«' '\2039' '\203A'; } </style> </head> <body> <div lang="fr"> <q> This French quote has a <q>nested</q> quote. </q> </div> <div lang="de"> <q> This German quote has a <q>nested</q> quote. </q> </div> <div lang="en"> <q> This English quote has a <q>nested</q> quote. </q> </div> </body> </html>