| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> |
| <title>Dynamic updating of :first-child and :last-child</title> |
| #two:first-child { background: red; } |
| #three:last-child { background: lime; } |
| <link rel="first" href="css3-modsel-1.html" title="Groups of selectors"> |
| <link rel="prev" href="css3-modsel-d2.html" title="Dynamic handling of combinators"> |
| <link rel="up" href="./index.html"> |
| <link rel="top" href="../../index.html"> |
| <script type="text/javascript"> |
| el2 = document.getElementById('two'); |
| el3 = document.getElementById('three'); |
| el2.parentNode.insertBefore(el3.nextSibling, el2); |
| window.setTimeout("test()", 100); |
| <div><p id="two">This line should be unstyled. (2)</p><p id="three">This line should have a green background. (3)</p><p>This line should be unstyled. (4 moving to 1)</p></div> |