css3-modsel-35.xml (946B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>:last-of-type pseudo-class</title> 5 <style type="text/css"><![CDATA[.red { background-color : red } 6 address { margin-bottom : 1em ; margin-left : 1em } 7 address:last-of-type { background-color : lime } 8 ]]></style> 9 <link rel="author" title="Daniel Glazman" href="http://glazman.org/"/> 10 <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> 11 <link rel="help" href="https://www.w3.org/TR/css3-selectors/#selectors"/> <!-- bogus link to make sure it gets found --> 12 </head> 13 <body> 14 <div> 15 <address>A first address with normal background</address> 16 <address>A second address with normal background</address> 17 <address class="red">A third address that should have a green background</address> 18 This div contains 3 addresses above this sentence.</div> 19 </body> 20 </html>