使页脚粘在底部 [英] making the footer stick the bottom

查看:137
本文介绍了使页脚粘在底部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我试图让页脚粘在页面的底部,就像这样
http:// cleanstickyfooter .herokuapp.com /



(放大并且页脚仍保留在底部)

我怎样才能做到这一点?



这是我做的测试,请帮我理解我需要做什么,因为页脚并没有停留在底部。
http://trulyamped.com/responr/Responr.html

解决方案

使用固定定位很容易实现:

  .body .mainfooter {
height:auto;
margin-top:0;
margin-bottom:0;
头寸:固定;
底部:0;
}


So im trying to make the footer stick to the bottom of the page like this http://cleanstickyfooter.herokuapp.com/

(zooming out and the footer still stays at the bottom)

How can i achieve this?

this is a test i made, please help me understand what i need to do because the footer is not staying at the bottom. http://trulyamped.com/responr/Responr.html

解决方案

This is easily achieved using fixed positioning:

.body .mainfooter {
    height: auto;
    margin-top: 0;
    margin-bottom: 0;
    position: fixed;
    bottom: 0;
}

这篇关于使页脚粘在底部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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