Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/selectors/nth-last-child-of-nesting.html - WPT Dashboard Interop Dashboard
<!doctype html>
<html>
<head>
<title>:nth-last-child nesting</title>
<link rel=author href="mailto:zach@zrhoffman.net" title="Zach Hoffman">
<link rel="match" href="nth-child-of-nesting-ref.html">
<style>
:nth-last-child(2n - 2 of :nth-last-child(n of .target)) {
background-color: lime;
}
</style>
</head>
<body>
<p>White</p>
<p class="target">Green</p>
<p>White</p>
<p class="target">White</p>
<p>White</p>
<p class="target">Green</p>
<p>White</p>
<p class="target">White</p>
<p>White</p>
<p class="target">Green</p>
<p>White</p>
<p class="target">White</p>
</body>
</html>