页脚没有停留在页面底部

时间:2016-04-29 22:30:32

标签: css footer

我意识到之前已经问过这个问题,但我已经尝试了

footer{
position: absolute;
bottom: 0;
margin-bottom: 0;
padding-bottom: 0;
}

html, body {
min-height: 100%;
padding: 0;
margin: 0;
}

我也尝试过CSS技巧方法https://css-tricks.com/snippets/css/sticky-footer/

这些选项都不适用于我(或者至少不适用于非常大的屏幕)。我还能尝试什么?感谢

3 个答案:

答案 0 :(得分:1)

试试这个:

// rather than using Monata directly:
MonetaryAmount amount = FastMoney.parse(bidStr, format);

// use the API:
MonetaryAmount amount = format.parse(bidStr);

答案 1 :(得分:0)

您缺少应用“粘性页脚”所必需的各种样式。这就是我一直这样做的方式

DEMO https://jsfiddle.net/zmbh0v4z/

html {
    position: relative;
    min-height: 100%;
}
body {
    margin: 0 0 100px; /* bottom = footer height */
}
footer {
  background: red;
    position: absolute;
    left: 0;
    bottom: 0;
    height: 100px;
    width: 100%;
}

答案 2 :(得分:-2)

试试这个:

HTML

<section class="footer id="footer">
Content
</section>

CSS

#footer {
background-color: #63C0B8;
color: #1e1e1e;
margin-bottom: 0px;
}

该主题标签重要

另请注意,页脚将保留在底部...但您需要先将内容放在其上方。

相关问题