adjacent-002

Selectors: Adjacent selectors with the universal selector

WeasyPrint

This browser

Assertion
Browsers should apply each rule to the adjacent element when combined with the universal selector

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: Selectors: Adjacent selectors with the universal selector</title>
 5   <link rel="author" title="Gabriele Romanato" href="mailto:gabriele.romanato@gmail.com">
 6   <link rel="help" href="http://www.w3.org/TR/CSS21/selector.html#adjacent-selectors">
 7   <meta name="flags" content="">
 8   <meta name="assert" content="Browsers should apply each rule to the adjacent element when combined with the universal selector">
 9 <style type="text/css">
10 body > p {color: silver}
11 
12 body > p + * {color: purple}
13 p + p + *  {color: black}
14 div + *{color: blue}
15 
16 </style>
17  </head>
18  <body>
19 <p>Filler text.</p>
20 <p>This text should be purple.</p>
21 <div>This text should be black.</div>
22 <h4>This text should be blue.</h4>
23  </body>
24 </html>