粘性页脚在较大的设备上不粘到屏幕底部 - Bootstrap

时间:2015-06-12 20:28:24

标签: javascript html css footer sticky-footer

我正在尝试创建粘贴在屏幕底部(未固定)的粘性页脚,并根据添加的内容量向下移动。

在较大的屏幕上,页脚不会粘住。

查看此处:http://www.bootply.com/VxVeDahZzG

1 个答案:

答案 0 :(得分:1)

我认为您需要将身体的大小更改为100%。这是一个很好的网站,帮助我弄明白。 http://ryanfait.com/sticky-footer/

他是这样做的:

* {
margin: 0;
}
html, body {
    height: 100%;
}
.wrapper {
    min-height: 100%;
    height: auto !important; 
    height: 100%;
    margin: 0 auto -155px; 
 }
.footer, .push {
    height: 155px; /* .push must be the same height as .footer */
}

您还需要将您的页脚放在身体外面才能使用。

相关问题