Fluid height main body with header and footer

我与影子孤独终老i 提交于 2019-12-02 10:52:41
James Donnelly

My answer here may help: Set div block to 100% height

Simply set the height of the footer and a negative margin on the content:

#footer { height:100px; }
#container { margin-bottom:-100px; padding-bottom:100px; }

Here is an example of how you'd include a footer: JSFiddle.

Do note that this will not work in IE7 due to its usage of box-sizing.

Edit: You'll also need to add padding to the container as well to prevent container text appearing under the footer. I've fixed the JSFiddle example to include this.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!