c16-descendant-001

Contextual selectors

WeasyPrint

This browser

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3  <head>
 4   <title>CSS Test: Contextual selectors</title>
 5   <link rel="help" href="http://www.w3.org/TR/REC-CSS1#contextual-selectors">
 6   <link rel="author" title="CSS1 Test Suite Contributors" href="http://www.w3.org/Style/CSS/Test/CSS1/current/tsack.html">
 7   <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch">
 8   <style type="text/css">
 9    ul {color: green;}
10    p {color: red;}
11    html body div p {color: green;}
12    span, ul li li {color: red;}
13   </style>
14   <link rel="help" href="http://www.w3.org/TR/CSS21/selector.html#descendant-selectors" title="5.5 Descendant selectors">
15  </head>
16  <body>
17   <div><p> This line should be green. </p></div>
18   <ul>
19    <li>
20     <span> </span> This line should be green.
21    </li>
22   </ul>
23  </body>
24 </html>