attribute-value-selector-010

lang attribute selector - att |= val

WeasyPrint

This browser

Flags
HTMLonly
Assertion
lang attribute selector with 'att |= val' in HTML should not be case sensitive, and match hyphen-separated list

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3   <head> 
 4     <title>CSS Test: lang attribute selector - att |= val</title> 
 5     <link rel="author" title="Richard Ishida" href="mailto:ishida@w3.org">
 6     <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com">
 7     <link rel="help" href="http://www.w3.org/TR/CSS21/selector.html#attribute-selectors">
 8     <meta name="flags" content="HTMLonly">
 9     <meta name="assert" content="lang attribute selector with 'att |= val' in HTML should not be case sensitive, and match hyphen-separated list">
10     <style type="text/css">
11       div[lang |= "es"] { color:white;background-color:green; }
12       p[lang |= "es"] { color:white;background-color:green; }
13       div[lang |= "en-GB"] { color:white;background-color:green; }
14       p[lang |= "fr"] { color:white;background-color:green; }
15       em[lang |= "de"] { color:white;background-color:green; }
16       div[xml:lang |= "it"] { color:white;background-color:green; }
17       div[lang |= "ch"] { color:white;background-color:green; }
18       div[lang=" no"] { color:white;background-color:green; }
19     </style> 
20   </head> 
21   <body> 
22 
23     <div lang="es">This line should be green</div> 
24     <div lang="es-MX">This line should be green</div> 
25     <div lang="ES">This line should be green</div> 
26     
27     <div lang="en-GB">This line should be green</div>
28     <div lang="en-GB-scouse">This line should be green</div> 
29 
30     <p lang="es">This line should be green <em>and this should be green too</em></p>
31 
32     <div lang="no">This line should NOT be green</div> 
33     <div lang="MX-es">This line should NOT be green</div>
34 
35     <div lang="en-US">This line should NOT be green</div> 
36     <div lang="en">This line should NOT be green</div>
37     
38     <div lang="fr">This line should NOT be green<p>This line should NOT be green</p></div> 
39     <p lang="de">This line should NOT be green <em>and this should not be green either</em></p>
40 </body> 
41 </html>