粘性页脚导致溢出

时间:2015-03-11 03:02:46

标签: html css

我正在创建一个网站,我希望页脚始终位于页面的末尾(不固定),但我遇到了麻烦。效果很好:

enter image description here

但是当我缩小视频时,内容“离开”页面并且页脚搞砸了:

enter image description here

如果有人可以帮助我,我将不胜感激! 这是链接:

http://myrtabaiter.com/site/alfareria.htm

PS:我没有添加代码,因为它会让我感到困惑,因为我用它来设置背景的方式很少......

1 个答案:

答案 0 :(得分:0)

Ryan Fait的CSS-only粘性页脚

* {
    margin: 0;
}
html, body {
    height: 100%;
}
.wrapper {
    min-height: 100%;
    height: auto !important; /* This line and the next line are not necessary unless you need IE6 support */
    height: 100%;
    margin: 0 auto -155px; /* the bottom margin is the negative value of the footer's height */
}
.footer, .push {
    height: 155px; /* .push must be the same height as .footer */
}

来源:Sticky Footer by Ryan Fait

相关问题