当内容短缺或缺少时,如何将页脚推到页面底部? [英] How to push a footer to the bottom of page when content is short or missing?

查看:80
本文介绍了当内容短缺或缺少时,如何将页脚推到页面底部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面包含一个外部div,它包含一个标题,内容和页脚div。我想要页脚div拥抱浏览器的底部,即使内容div不够高,不足以填充可见区域(即没有滚动)。

解决方案

使用min-height属性为你的内容div设置一些最小高度



显然这在IE中不起作用,因此可以考虑使用

http://www.cssstickyfooter.com/



由其他人建议


I have a page with an outer div that wraps a header, content and footer div. I want the footer div to hug the bottom of the browser, even when the content div is not tall enough to fill the viewable area (i.e. there's no scrolling).

解决方案

Set some minimum height for you content div using min-height property

apparently this does not work in IE so may consider using

http://www.cssstickyfooter.com/

as suggested by some others

这篇关于当内容短缺或缺少时,如何将页脚推到页面底部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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