Divs并没有围绕内部div。 [英] Divs isn't wrapping around inner div's.

查看:83
本文介绍了Divs并没有围绕内部div。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我一直在网站上工作,而.garrov1mainbody并没有包围它的3个孩子。下面是 http://jsfiddle.net/olivermurfett/t98fby2r/ 的链接。我把红色边框放在主体周围以显示它没有包裹。

解决方案

这是由你的页脚引起的。

你在它上面做了一个clearfix,因为上面的元素都有一个浮点数。

但是这个位置也是固定的,会把它从文档流中取出来。

添加一个有一个明确的页脚上方的div:两个都修复了这个。



http: //jsfiddle.net/t98fby2r/1/ [ ^ ]

So, I've been working on a website and the ".garrov1mainbody" isn't wrapping around it's 3 children. Heres the link http://jsfiddle.net/olivermurfett/t98fby2r/ . I've put the red border around the mainbody to show it isn't wrapping.

解决方案

It's caused by you're footer.
You do a clearfix on it because the elements above have a float.
But also having the position fixed will take it out of the flow of the document.
Adding a div above the footer which has a clear: both fixes this.

http://jsfiddle.net/t98fby2r/1/[^]


这篇关于Divs并没有围绕内部div。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆