adjacent-000

Selectors: Adjacent selectors

WeasyPrint

This browser

Assertion
Browsers should apply each rule to the adjacent element

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</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">
 9 <style type="text/css">
10 body > p {color: gray}
11 
12 p + p {color: purple}
13 p + div {color: black}
14 div + h4 {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>