margin-collapsing-dynamic.html (625B)
1 <!DOCTYPE html> 2 <link rel="match" href="../../reference/ref-filled-green-100px-square.xht" /> 3 <link rel="help" href="https://www.w3.org/TR/CSS22/box.html#collapsing-margins" title="8.3.1 Collapsing margins"> 4 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 5 <div style="width: 100px; height: 100px; background: green;"></div> 6 <div style="width: 0; height: 0; outline: solid red 50px; position: relative; z-index: 1; overflow: clip; margin-left: 50px;"> 7 <div id="target"></div> 8 </div> 9 <script> 10 document.body.offsetTop; 11 document.getElementById('target').style.marginTop = '-1000px'; 12 </script>