Sticky Footer

来源:互联网 发布:支付软件注册条件 编辑:程序博客网 时间:2024/05/16 03:11

我们常常需要把footer放置在页面的最低端,那么如果页面的内容高度不够,footer并不会自动置于底端。我们需要进行自定义CSS:

html {    min-height: 100%; /* 非常重要 */    position: relative;}body {    /* Margin bottom by footer height */    margin-bottom: 80px;}.footer {    position: absolute;    bottom: 0;    width: 100%;    height: 80px;}

简单,但却是最完美的解决方案。