【发布时间】:2017-07-19 12:48:54
【问题描述】:
我在一个简单的页脚上绕了 1 天,该页脚位于页面底部,未固定。
我已经设法将它放在全屏页面的底部。但是,当我减小浏览器窗口的宽度以模拟“响应式显示”时,当我向下滚动页面时,页脚会停留在同一位置,因此不会向下刷新。
这是我的html:
<html>
<body>
<div class="container">
<div class="row text-center">
<p> Blablabla </p>
</div> <!-- row -->
</div> <!-- container -->
<div class="footer text-center">
<p class="small">Alright !</p>
</div>
</body>
</html>
还有我的 CSS:
html {
height: 100%;
}
body {
height: 100%;
padding-bottom: 30px;
}
.footer {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 30px;
}
我在页脚上尝试过 Bootstrap 的列,如下所示:
<div class="col-md-12 col-xs-12">
<div class="footer text-center">
<p class="small">© 2017 Le Point G</p>
</div>
</div>
但是这种方法似乎不合适,因为它在我的不同页面上不一致,因为内容量从一个页面到另一个页面不同,或多或少地向下推页脚。
有更好的建议吗?
【问题讨论】:
标签: css twitter-bootstrap footer responsive sticky-footer