且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Divs并没有围绕内部div。

更新时间:2023-01-15 10:47:20

这是由你的页脚引起的。

你在它上面做了一个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/[^]