min-height-percentage-001

Min-height percentage is based on containing block

WeasyPrint

This browser

Assertion
A percentage for 'min-height' is calculated with respect to the 'height' of the generated boxes containing block.

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: Min-height percentage is based on containing block</title>
 5         <link rel="author" title="Microsoft" href="http://www.microsoft.com/">
 6         <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-heights">
 7         <meta name="flags" content="">
 8         <meta name="assert" content="A percentage for 'min-height' is calculated with respect to the 'height' of the generated boxes containing block.">
 9         <style type="text/css">
10             #div1
11             {
12                 height: 2in;
13                 position: relative;
14             }
15             div div
16             {
17                 width: 1in;
18             }
19             #div2
20             {
21                 background: blue;
22                 min-height: 50%;
23             }
24             #div3
25             {
26                 background: orange;
27                 height: 1in;
28                 left: 1in;
29                 position: absolute;
30                 top: 0;
31             }
32         </style>
33     </head>
34     <body>
35         <p>Test passes if the blue and orange boxes below are the same height.</p>
36         <div id="div1">
37             <div id="div2"></div>
38             <div id="div3"></div>
39         </div>
40     </body>
41 </html>