<!DOCTYPE html> | |
<p>There should be no red on this page.</p> | |
<div style="position:relative;"> | |
<div id="elm" style="width:200px; height:200px; background:red;"> | |
<div style="position:absolute; top:0; width:200px; height:200px; background:green;"></div> | |
</div> | |
</div> | |
<script> | |
document.body.offsetTop; | |
document.getElementById("elm").style.marginLeft = "200px"; | |
</script> |