servo/tests/ref/nth_child_pseudo_a.html
2015-07-23 18:53:57 +02:00

90 lines
2 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>:nth-child test</title>
<style type="text/css">
html { background: red; }
/* Should match according to Selectors Level 4 (changed from Level 3) */
html:nth-child(1) { background: white; }
div > p { float: left; width: 40px; height: 40px; margin-right: 10px; border: 1px solid black; }
div { clear: both; }
#odd > .odd { background: red; }
#odd > *:nth-child(odd) { background: green }
#even > .even { background: red; }
#even > *:nth-child(even) { background: green }
#nth > .nth { background: red; }
#nth > :nth-child(3n+5) { background: green; }
#nth2 > .nth2 { background: red; }
#nth2 > :nth-child(3n-5) { background: green; }
#negativen > .negativen { background: red; }
#negativen > :nth-child(-2n+5) { background: green; }
</style>
</head>
<body>
<div id="odd">
<p class="odd"> </p>
<p> </p>
<p class="odd"> </p>
<p> </p>
<p class="odd"> </p>
<p> </p>
<p class="odd"> </p>
<p> </p>
</div>
<div id="even">
<p> </p>
<p class="even"> </p>
<p> </p>
<p class="even"> </p>
<p> </p>
<p class="even"> </p>
<p> </p>
<p class="even"> </p>
</div>
<div id="nth">
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p class="nth"> </p>
<p> </p>
<p> </p>
<p class="nth"> </p>
<p> </p>
<p> </p>
<p class="nth"> </p>
</div>
<div id="nth2">
<p class="nth2"> </p>
<p> </p>
<p> </p>
<p class="nth2"> </p>
<p> </p>
<p> </p>
<p class="nth2"> </p>
<p> </p>
<p> </p>
<p class="nth2"> </p>
<p> </p>
</div>
<div id="negativen">
<p class="negativen"> </p>
<p> </p>
<p class="negativen"> </p>
<p> </p>
<p class="negativen"> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</div>
</body>
</html>