图片总是把DIV撑高4像素,不知为什么??下面的方法能解决,不过总觉得不是很完美,总要定义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="http://www.google.cn/intl/zh-CN/images/logo_cn.gif" ></li>
</ul></div><div style="clear:both;"></div>
<div id="test2"><ul><li><img src="http://www.google.cn/intl/zh-CN/images/logo_cn.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>