<div id="target" style="width: 200px; height: 100px; background-color: red;"> <div style="width: 100px; background-color: green;"> <span style="float: left; width: 10px; height: 100px;"> </span> <br style="clear: both;"> </div> </div> <script> document.body.offsetTop; document.getElementById("target").style.width = "100px"; </script>