css3-modsel-27a.xml (1252B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>Impossible rules (:root:first-child, etc)</title> 5 <style type="text/css"><![CDATA[ 6 :root:first-child { background-color: red; } 7 :root:last-child { background-color: red; } 8 :root:only-child { background-color: red; } 9 :root:nth-child(1) { background-color: red; } 10 :root:nth-child(n) { background-color: red; } 11 :root:nth-last-child(1) { background-color: red; } 12 :root:nth-last-child(n) { background-color: red; } 13 :root:first-of-type { background-color: red; } 14 :root:last-of-type { background-color: red; } 15 :root:only-of-type { background-color: red; } 16 :root:nth-of-type(1) { background-color: red; } 17 :root:nth-of-type(n) { background-color: red; } 18 :root:nth-last-of-type(1) { background-color: red; } 19 :root:nth-last-of-type(n) { background-color: red; } 20 p { color: green; }]]></style> 21 <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> 22 <link rel="help" href="https://www.w3.org/TR/css3-selectors/#selectors"/> <!-- bogus link to make sure it gets found --> 23 </head> 24 <body> 25 <p>This line should be green (there should be no red on this page).</p> 26 </body> 27 </html>