abs-pos-child-sizing-ref.html (1300B)
1 <!DOCTYPE HTML> 2 <html><head> 3 <meta charset="utf-8"> 4 <title>Testcase for bug 971653</title> 5 <style type="text/css"> 6 html,body { 7 color:black; background-color:white; font-size:16px; padding:0; margin:0; 8 } 9 10 div { 11 position: absolute; 12 background: rgba(0,255,0,0.5); 13 top:0; bottom:0; 14 left:0; right:0; 15 z-index: 0; 16 } 17 c { 18 display: block; 19 background: blue; 20 height:100%; 21 } 22 23 legend { height: 24px; } 24 25 fieldset { 26 position: absolute; 27 border: 2px green solid; 28 width: 100px; 29 height: 100px; 30 margin-bottom:40px; 31 } 32 33 #t1,#t3 { padding: 3px 5px 7px 11px; } 34 #t2,#t4 { padding: 0; } 35 36 #t1 div, #t3 div { 37 /* same numbers as padding above */ 38 left: -11px; right: -5px; 39 top: -3px; bottom:-7px; 40 } 41 42 #t2 { top: 120px; } 43 #t3 { top: 240px; } 44 #t4 { top: 360px; } 45 46 x { 47 position: absolute; 48 width:100px; 49 height:100px; 50 } 51 #t1 x, #t2 x { 52 height:78px; /* compensate for legend */ 53 } 54 </style> 55 </head> 56 <body> 57 58 59 <fieldset id="t1"> 60 <legend>legend</legend> 61 <x><div></div><c></c></x> 62 </fieldset> 63 64 <fieldset id="t2"> 65 <legend>legend</legend> 66 <x><div></div></x> 67 </fieldset> 68 69 <fieldset id="t3"> 70 <x><div></div><c></c></x> 71 </fieldset> 72 73 <fieldset id="t4"> 74 <x><div></div></x> 75 </fieldset> 76 77 78 </body> 79 </html>