abspos-overflow-012

Positioning, Overflow, and Clipping: Does 'overflow:auto' affect positioned elements that are relative to elements outside the overflow

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: Positioning, Overflow, and Clipping: Does 'overflow:auto' affect positioned elements that are relative to elements outside the overflow</title>
 5   <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch">
 6   <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/absolute/overflow/012.html" type="text/html">
 7   <link rel="help" href="http://www.w3.org/TR/CSS21/visufx.html#overflow-clipping">
 8   <style type="text/css">
 9    #outer {
10     position: relative;
11     height: 1em;
12     width: 20em;
13     background: red;
14    }
15    #inner {
16     overflow: auto; /* this rule should be irrelevant since the element is empty and thus has zero height */
17    }
18    #positioned {
19     position: absolute; /* relative to the outer div */
20     top: 0;
21     width: 20em;
22     background: white;
23     color: green;
24    } 
25   </style>
26  </head>
27  <body>
28   <p>There should be no red below.</p>
29   <div id="outer">
30    <div id="inner">
31     <div id="positioned"> This text should be green. </div>
32    </div>
33   </div>
34  </body>
35 </html>