nth-last-child-of-complex-selector.html (716B)
1 <!doctype html> 2 <html> 3 <head> 4 <title>:nth-last-child with complex selector list argument</title> 5 <link rel="help" href="https://drafts.csswg.org/selectors-4/#child-index"> 6 <link rel="match" href="nth-last-child-of-complex-selector-ref.html"> 7 <style> 8 p:nth-last-child(4n of html:root>body>p+p:not(empty), :not(*), p:not(p), span, .notthere) { 9 background-color: lime; 10 } 11 </style> 12 </head> 13 <body> 14 <p>This test the styling of paragraphs with :nth-last-child(An+B of selector). If the test succeed, paragraphs that say "green" should have a green background.</p> 15 <p>Green</p> 16 <p>White</p> 17 <p>White</p> 18 <p>White</p> 19 <p>Green</p> 20 <p>White</p> 21 <p>White</p> 22 <p>White</p> 23 </body> 24 </html>