将CSS这样定义,将宽度和高度定义在内层容器
<HTML>
<BODY>
    <DIV>
        <DIV id="adspace" style="background-color:gray;width:100px;height:100px;overflow:hidden;">SASSASAAAAAAAAAAAAAAAA Scvaa</DIV>
    </DIV>
<script lanaguge="javascript">
    var e = document.getElementById('adspace');
    alert("offsetWidth:" + e.offsetWidth);
    alert("offsetHeight:" + e.offsetHeight);
</script>
</BODY>
</HTML>