

In a document, selects the elements that are in a given language.
Syntax
HTML :lang(C) { sRules } Scripting N/A
Possible Values
sRules String that specifies one or more Cascading Style Sheets (CSS) attribute-value pairs.
Remarks
The set rules are applied when the value of C matches (or is a hyphen-separated substring of) the element's language value. The value of C should be a language code that is indicated by RFC-3066
.
If C is empty or invalid, the selector will have no effect.
This pseudo-class requires that Internet Explorer be in IE8 mode rendering. For more information, see Defining Document Compatibility.
Example
The following code example, which is reproduced from the Windows Internet Explorer Testing Center on MSDN, uses the :lang pseudo-class to apply a color to any p elements that are explicitly given a language value (or a hyphen-separated subset thereof) of "en." The first paragraph gets "en-us" (a subset of "en") and thus turns green.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>:lang pseudo-class</title> <style type="text/css"> p:lang(en) { color: green } </style> </head> <body> <p lang="en-us">This text should be green.</p> <p>This text should NOT be green.</p> <div lang="en-us">This text should NOT be green.</div> </body> </html>
Applies To
A, ABBR, ACRONYM, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, DD, DFN, DIR, DIV, DL, DT, EM, FORM, hn, HTML, I, IMG, INPUT, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, KBD, LABEL, LEGEND, LI, LISTING, MARQUEE, MENU, OL, P, PRE, S, SAMP, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR

.gif)