div 浮动容器底部的额外空间
这是当前的设置:
<div id="youtubelatestnews">
<div class="box youtubebox">
</div>
<div class="latestnews">
</div>
<div class="clear"></div>
</div>
但问题是容器
(“youtubelatestnews”)底部空间太大。这是网站:http://voila.easywebprojects.com/
This is the current setup:
<div id="youtubelatestnews">
<div class="box youtubebox">
</div>
<div class="latestnews">
</div>
<div class="clear"></div>
</div>
But the problem is the container <div>
which is "youtubelatestnews" has too much space at the bottom.
Here's the site: http://voila.easywebprojects.com/
The <div>
s I'm referring to are the sneak peek & Latest News portion.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
尝试将
float:left;
样式添加到youtubelatestnews
div,它对我有用;-)Try to add
float:left;
style toyoutubelatestnews
div, it worked for me ;-)额外空间的原因是清除了 div,它也会清除左侧元素下方的内容。
您可以删除clear div,并在#youtubelatestnews div 上使用
overflow:hidden;
。由于您没有为其指定高度,因此溢出样式只会使该元素包含其子元素。The reason for the extra space is the clear div, which will clear below the elements on the left also.
You can remove the clear div, and use
overflow: hidden;
on the #youtubelatestnews div. As you don't have a height specified for it, the overflow style will only make the element contain its children..box-product > 上的 margin-bottom div
加上.box
上的 margin-bottom 正在组合。The margin-bottom on
.box-product > div
plus the margin-bottom on.box
are combining.有时,额外的空间可能是由透明项目的默认高度引起的,
尝试添加
height:0px
以获得清晰的 .https://jsfiddle.net/8zpt7tm3/
The extra space can be caused by the default height of clear item sometimes,
Try to add
height:0px
for the clear .https://jsfiddle.net/8zpt7tm3/