first-child-000.xht (988B)
1 <?xml version="1.0" encoding="utf-8"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 3 <html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <title>CSS Test: Selectors: The :first-child pseudo-class</title> 6 <link rel="author" title="Gabriele Romanato" href="mailto:gabriele.romanato@gmail.com" /> 7 <link rel="help" href="http://www.w3.org/TR/CSS21/selector.html#first-child" /> 8 <link rel="match" href="first-child-000-ref.html"/> 9 <meta name="assert" content="Browsers should apply each rule to the element which is the first child of its parent"/> 10 <style type="text/css"> 11 * {color: silver} 12 em:first-child {color: fuchsia;} 13 div:first-child {color: orange;} 14 span:first-child {color: blue} 15 </style> 16 </head> 17 <body> 18 <p><em>This text should be fuchsia.</em> Filler text.</p> 19 <div><div>This text should be orange.</div> <p>Filler text.</p></div> 20 <h4><span>This text should be blue.</span> <span>Filler text.</span></h4> 21 </body> 22 </html>