Maison > Article > interface Web > Div的高度大于一定数值后,IE8自动调整其高度为一固定值_html/css_WEB-ITnose
<div style="height: 200px; width: 100%; overflow: auto; position: relative;" id="div1"> <div style="height: 2000000px; width: 1000px;" id="hugeDiv"> </div> XXXXXXXXXX</div>
<!DOCTYPE HTML><html lang=""><head> <meta charset="gbk"> <title></title></head><body> <div style="height: 200px; width: 100%; overflow: auto; position: relative;" id="div1"> <div style="height: 2000000px; width: 1000px;" id="hugeDiv"></div> XXXXXXXXXX </div> <script type="text/javascript"> alert( document.getElementById('hugeDiv').offsetHeight ) </script></body></html>
HTML code
nbsp;HTML>
应该就是个显示上限的问题吧
比如
<!DOCTYPE HTML><html lang=""><head> <meta charset="gbk"> <title></title></head><body> <div style="height: 200px; width: 100%; overflow: auto; position: relative;" id="div1"> <div style="height: 123456789px; width: 1000px;" id="hugeDiv"></div> XXXXXXXXXX </div> <div id="test"></div> <script type="text/javascript"> document.getElementById('test').innerHTML = document.getElementById('hugeDiv').offsetHeight; </script></body></html>
正需要
应该就是个显示上限的问题吧
比如
HTML code
nbsp;HTML>