Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<meta charset="utf-8" />
<title>CSS Selectors Invalidation: :nth-child(... of class) as ancestor</title>
<link rel="author" title="Steinar H. Gunderson" href="sesse@chromium.org">
<link rel="match" href="nth-child-of-in-ancestor-ref.html">
<style>
p:nth-child(odd of .c) span {
color: green;
}
</style>
<div>
<p class="c">Not <span>ignored</span></p>
<p class="c" id="toggler">Selectively <span>ignored<span></p>
<p class="c">Not <span>ignored</span></p>
<p class="c">Not <span>ignored</span></p>
<p class="c">Not <span>ignored</span></p>
<p>Ignored</p>
</div>
<script>
document.documentElement.offsetTop;
toggler.classList.toggle("c");
</script>