Img和div之间的差距 [英] Gap between Img and div
本文介绍了Img和div之间的差距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个img和div,我找不到原因.我见过这样的问题.但这对我不起作用,我也尝试使用margin:0.这是我的我的小提琴.但是我找不到为什么这个差距在这里.谢谢
I have an img and div i can't find why there is a gap. I have seen so question. But it is not working for me i have also tried using margin:0. here is my My fiddle. But i cant find why this gap is here. Thanks
<img src="http://www.kidsmathgamesonline.com/images/pictures/shapes/rectangle.jpg" class="header"/>
<div class="body-middle">
</div>
css是:-
.header
{
width:100%;
height:auto;
padding:0px;
margin:0px;
}
.body-middle
{
height:50px;
width:100%;
margin:0 auto;
background:url('http://www.clipartsfree.net/vector/large/simple_green_rectangle_Vector_Clipart.png') 0 0 repeat;
background-size:contain;
background-position:center top;
}
推荐答案
为图像提供 display:block
.
.header{
display:block;
}
这篇关于Img和div之间的差距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文