nth-child-of-compound-selector.html (982B)
1 <!doctype html> 2 <html> 3 <head> 4 <title>:nth-child with compound selector argument</title> 5 <link rel="help" href="https://drafts.csswg.org/selectors-4/#child-index"> 6 <link rel="match" href="nth-child-of-compound-selector-ref.html"> 7 <style> 8 /* 3n of paragraph with the class foobar but for which foobar is not the only class. */ 9 p:nth-child(3n+1 of p.foobar:not([class=foobar])) { 10 background-color: lime; 11 } 12 </style> 13 </head> 14 <body> 15 <p class="foobar foo"></p> 16 <p>This test the styling of paragraphs with :nth-child(An+B of selector). If the test succeed, paragraphs that say "green" should have a green background.</p> 17 <p class="foobar">White!</p> 18 <p class="foobar foo">White!</p> 19 <p>White!</p> 20 <p class="foo foobar">White!</p> 21 <p>White!</p> 22 <p class="foobar foo">Green</p> 23 <p class="foobar">White!</p> 24 <p class="foo foobar">White!</p> 25 <p class="foobar">White!</p> 26 <p class="foo foobar baz">White!</p> 27 <p>White!</p> 28 </body> 29 </html>