Revision dd3f71885bd5039f7ba6f357ac2a43fc510ee23f authored by Mike Pennisi on 23 December 2017, 00:01:51 UTC, committed by jgraham on 23 April 2018, 17:11:42 UTC
1 parent 18ee2b4
Raw File
css3-modsel-d4.xml
<csstest def="Dynamic updating of :first-child and :last-child" module="W3C Selectors" modulename="css3-modsel" number="d4" rev="1.1" date="3-march-2004" xmlns="http://www.example.org/css3tests">

<author>Ian Hickson</author>

<dynamic/>

<cssrules>
   #two:first-child { background: red; }
   #three:last-child { background: lime; }
</cssrules>

<code>

 <div xmlns="http://www.w3.org/1999/xhtml">

  <script type="text/javascript">
   <![CDATA[

    function test() {
      el2 = document.getElementById('two');
      el3 = document.getElementById('three');
      el2.parentNode.insertBefore(el3.nextSibling, el2);
    }

    window.setTimeout("test()", 100);
   ]]>
  </script>

  <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>

 </div>

</code>
</csstest>
back to top