【发布时间】:2016-01-21 17:43:42
【问题描述】:
我正在尝试让页脚保持在底部。我通过谷歌搜索过,但我的代码没有运气。我试过navbar-fixed-bottom,但这只会让页脚内容在它下面滚动,并且它保持固定,这是我不想要的。
这是我当前的代码:
HTML
<footer>
<div class="container">
<p class="text-p"><img src="images/footer-logo.png"> © 2015 <a href="http://www.domainname.no">Domainname.no</a>. All rights reserved.
<!--<a href="https://www.facebook.com/Helsespesialisten-448789105236638/" target="_blank"><i class="fa fa-facebook"></i>Follow us on Facebook</a>-->
</div>
</footer>
CSS
footer {
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
height: 60px;
background-color: #f5f5f5;
}
.text-p{
text-shadow: none;
font-size: 14px;
color: #999;
padding: 20px 0 0 5px;
}
如果有任何帮助,我将不胜感激!如果您需要其余代码,请告诉我。
【问题讨论】:
-
使用“位置:固定”
-
提问前总是先搜索
-
@LaljiTadhani 我不希望它被修复,如帖子中所述。我试过
navbar-fixed-bottom -
www.cssreset.com/demos/layouts/how-to-keep-footer-at-bottom-of-page-with-css/
-
@LaljiTadhani 链接已损坏
标签: html css twitter-bootstrap-3 footer sticky-footer