css3-modsel-34.xml (858B)
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>:first-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:first-of-type { background-color : lime } 8 ]]></style> 9 <link rel="author" title="Daniel Glazman" href="http://glazman.org/"/> 10 <link rel="help" href="https://www.w3.org/TR/css3-selectors/#selectors"/> <!-- bogus link to make sure it gets found --> 11 </head> 12 <body> 13 <div>This div contains 3 addresses: 14 <address class="red">A first address that should have a green background</address> 15 <address>A second address with normal background</address> 16 <address>A third address with normal background</address> 17 </div> 18 </body> 19 </html>