<div><ul><li><img>图片和DIV上缘有个很大的空隙,怎么才能消除掉
CSS:
#nr_buttom
{
width:660px;
height:140px;
background-color:red;
margin-left:20px;
margin-top:20px;
}
#change { padding:0px; list-style-type:none; float:left; list-style:none;}
#change ul{ padding:0px; margin:0px;list-style-type:none;list-style:none;}
#change li{height:140px; text-align:left; margin:0px; padding:0px; list-style:none;list-style-type:none;}
#change img { margin:0px; padding:0px;}
HTML:
<div id="nr_buttom">
<ul id="change">
<li>
<img src="images/gg_h1.jpg" />
</li>
<li>
<img src="images/gg_h2.jpg" />
</li>
</ul>
</div>
下图就是最后效果,我特意在#nr_buttom里底色蓝色,方便观看效果。两张图片之间无缝,第一张图片和DIV上边之间很大一个空隙,该怎么消除掉?
img=http://img.my.csdn.net/uploads/201212/15/1355538129_1491.jpg][/img]
------解决方案--------------------#change{ margin:0; .... }
------解决方案-------------------- #nr_buttom
{
margin-top:20px;
}
把margin-top:20px;去掉看看?
------解决方案--------------------加个样式吧~
ul{
margin:0px 0px;
padding:0px 0px;
list-style-type:none;
}
这样就可以正常了哦~~~