div之间的额外空间从何而来? [英] Where is this extra space between divs coming from?
问题描述
http://www.lethalmonk6.byethost24.com/index.html
如果使用萤火虫检查项目链接" div之间的间距,则每个div之间会有一些增加的边距像素.我将边距设置为20 px,然后添加了这些点点滴滴.它来自哪里?
If you inspect with firebug the spacing between the "project-link" divs, there are a few pixels of added margin between each div. I have the margin set to 20 px, and then these little bits gets added on. Where is it coming from?
推荐答案
您正在使用display:inline-block
,因此元素之间的空白就是您所看到的.您可以删除div之间的空白,也可以使用float: left
.
You're using display:inline-block
so the white space between the elements is what you are seeing there. You can either remove the white space between the divs or use float: left
instead.
要详细说明...,如果您使用的是display: inline-block
,请执行以下操作:
To elaborate... if you're using display: inline-block
do this:
<div></div><div></div>
代替此:
<div></div>
<div></div> // White space is added because of the new line
这篇关于div之间的额外空间从何而来?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!