containing-block-percent-margin-top.html (749B)
1 <!DOCTYPE html> 2 <link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org"> 3 <link rel="help" href="https://www.w3.org/TR/CSS22/box.html#propdef-margin-top"> 4 <style> 5 #container { overflow:hidden; background:blue; } 6 #container > div { margin-top:50%; height:50px; } 7 </style> 8 <p>There should be a blue square below.</p> 9 <div id="container" style="width:456px;" data-expected-width="100" data-expected-height="100"> 10 <div></div> 11 </div> 12 <script src="/resources/testharness.js"></script> 13 <script src="/resources/testharnessreport.js"></script> 14 <script src="/resources/check-layout-th.js"></script> 15 <script> 16 document.body.offsetTop; 17 document.getElementById("container").style.width = "100px"; 18 checkLayout("#container"); 19 </script>