<?xml-stylesheet href="../../../style/xml-full.css" type="text/css"?>
<?xml-stylesheet href="css3-modsel-31.css" type="text/css"?>
<test xmlns:xlink="http://www.w3.org/1999/xlink">
 <title>:nth-last-of-type() pseudo-class</title>
 <author>Daniel Glazman</author>
 <metadata>
  <item> <name>CSS 3 Module</name> <data>W3C Selectors</data> </item>
  <item> <name>Next</name> <data xlink:type="simple" xlink:href="css3-modsel-32.xml">:first-child pseudo-class</data> </item>
  <item> <name>Previous</name> <data xlink:type="simple" xlink:href="css3-modsel-30.xml">:nth-of-type() pseudo-class</data> </item>
  <item> <name>Test #</name> <data>31 of 246 of the static tests category</data> </item>
  <item> <name>Testing</name> <data>:nth-last-of-type() pseudo-class</data> </item>
  <item> <name>ID</name> <data>31</data> </item>
  <item> <name>Date</name> <data>11-july-2001</data> </item>
  <item> <name>Revision</name> <data>1.0</data> </item>
 </metadata>
  <content xmlns:a="http://www.example.org/a" xmlns:b="http://www.example.org/b" xmlns:html="http://www.w3.org/1999/xhtml">
<p xmlns="http://www.w3.org/1999/xhtml" class="red">This paragraph should have green background</p>
<address xmlns="http://www.w3.org/1999/xhtml">But this address is here only to fill space in the dom..</address>
<p xmlns="http://www.w3.org/1999/xhtml">So does this paragraph !</p>
<p xmlns="http://www.w3.org/1999/xhtml">And so does this one too.</p>
<dl xmlns="http://www.w3.org/1999/xhtml">
  <dt>First definition term</dt>
    <dd>First definition</dd>
  <dt>Second definition term</dt>
    <dd>Second definition</dd>
  <dt class="red">Third definition term that should have green background</dt>
    <dd class="red">Third definition that should have green background</dd>
  <dt>Fourth definition term</dt>
    <dd>Fourth definition</dd>
  <dt>Fifth definition term</dt>
    <dd>Fifth definition</dd>
  <dt class="red">Sixth definition term that should have green background</dt>
    <dd class="red">Sixth definition that should have green background</dd>
</dl>
</content>
  <source>
   <css>.red { background-color : red }
p:nth-last-of-type(3) { background-color : lime }
dl &gt; :nth-last-of-type(3n+1) { background-color : lime }
</css>
   <xml>
&lt;p xmlns=&quot;http://www.w3.org/1999/xhtml&quot; class=&quot;red&quot;&gt;This paragraph should have green background&lt;/p&gt;
&lt;address xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;But this address is here only to fill space in the dom..&lt;/address&gt;
&lt;p xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;So does this paragraph !&lt;/p&gt;
&lt;p xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;And so does this one too.&lt;/p&gt;
&lt;dl xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
  &lt;dt&gt;First definition term&lt;/dt&gt;
    &lt;dd&gt;First definition&lt;/dd&gt;
  &lt;dt&gt;Second definition term&lt;/dt&gt;
    &lt;dd&gt;Second definition&lt;/dd&gt;
  &lt;dt class=&quot;red&quot;&gt;Third definition term that should have green background&lt;/dt&gt;
    &lt;dd class=&quot;red&quot;&gt;Third definition that should have green background&lt;/dd&gt;
  &lt;dt&gt;Fourth definition term&lt;/dt&gt;
    &lt;dd&gt;Fourth definition&lt;/dd&gt;
  &lt;dt&gt;Fifth definition term&lt;/dt&gt;
    &lt;dd&gt;Fifth definition&lt;/dd&gt;
  &lt;dt class=&quot;red&quot;&gt;Sixth definition term that should have green background&lt;/dt&gt;
    &lt;dd class=&quot;red&quot;&gt;Sixth definition that should have green background&lt;/dd&gt;
&lt;/dl&gt;
</xml>
  </source>
</test>