DIV被图片撑开的解决办法

<style>
*{margin:0; padding:0}
#test1{ background:#ff0000; height:110px; overflow:hidden}
#test1 li{ list-style:none; }
#test2{ background:#ffff00; }
</style>
</head>
<body>
<div id="test1"><ul><li><img src="/upload/remotpic/200741701410383.gif" ></li>
</ul></div><div style="clear:both;"></div>
<div id="test2"><ul><li><img src="/upload/remotpic/200741701410383.gif" ></li>
</ul></div><div style="clear:both;"></div>
<div><script>
document.write("图层一的高度是"+document.getElementById("test1").offsetHeight);
document.write("--------图层一的高度是"+document.getElementById("test2").offsetHeight);
</script></div>
posted @ 2008-02-14 18:08  龍峸.大卫  阅读(829)  评论(0编辑  收藏  举报