nth-last-child-of-in-ancestor.html (857B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <title>CSS Selectors Invalidation: :nth-last-child(... of class) as ancestor</title> 4 <link rel="author" title="Zach Hoffman" href="mailto:zach@zrhoffman.net"> 5 <link rel="author" title="Steinar H. Gunderson" href="mailto:sesse@chromium.org"> 6 <link rel="match" href="nth-last-child-of-in-ancestor-ref.html"> 7 <link rel="help" href="https://drafts.csswg.org/selectors-4/#child-index"> 8 <style> 9 p:nth-last-child(odd of .c) span { 10 color: green; 11 } 12 </style> 13 <div> 14 <p>Ignored</p> 15 <p class="c">Not <span>ignored</span></p> 16 <p class="c">Not <span>ignored</span></p> 17 <p class="c">Not <span>ignored</span></p> 18 <p class="c" id="toggler">Selectively <span>ignored</span></p> 19 <p class="c">Not <span>ignored</span></p> 20 </div> 21 <script> 22 document.documentElement.offsetTop; 23 toggler.classList.toggle("c"); 24 </script>