OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <style> | |
3 #container { overflow:hidden; width:40px; height:40px; background:red; } | |
4 #abspos { position:absolute; display:none; width:40px; height:20px; backgrou nd:green; } | |
5 #sibling { margin-top:20px; width:40px; height:20px; background:green; } | |
6 </style> | |
7 <p>There should be a green square below, and no red.</p> | |
8 <div id="container"> | |
9 <span> | |
10 <div id="abspos"></div><div id="sibling"></div> | |
11 </span> | |
12 </div> | |
13 <script> | |
14 document.body.offsetTop; | |
15 abspos.style.display = "block"; | |
16 </script> | |
OLD | NEW |