css - 使页脚始终延伸到底部的最佳方法

标签 css

我的页脚与网站的其他部分颜色不同,高度大约为 400 像素。当页面上没有很多内容时,我会在页脚下方显示一个白色条。如果需要,我希望页脚延伸到窗口底部。

不想在我的页面底部有一个粘性页脚。

也使用 Foundation 框架,以防万一。

<section id="footer">
  <div class="row">
    <div class="small-12 columns">
      <ul id="footer-links">
        <li></li>
        <li></li>
      </ul>
    </div>
  </div>
</section>


#footer {
    padding:60px 0px;
    text-align:center;
    background-color:#6f6f6f;
    color:#aaa;
    height:100%;
}
#footer-links {
    list-style-type: none;
    width:100%;
    text-indent:0px;
    margin: 0px;
    padding: 0px;
}
#footer-links li {
    display:inline;
}
#footer-links a {
    text-decoration:none;
    font-family:helvetica,sans-serif;
    font-weight:100;
    font-size:1.1em;
    color:#ddd;
    margin-left:10px;
    margin-right:10px;
    text-transform:lowercase;
}

最佳答案

使用粘性页脚: http://www.cssstickyfooter.com/

还有一种方法可以使用 twitter bootstrap 使其与它一起工作: http://getbootstrap.com/2.3.2/examples/sticky-footer.html

关于css - 使页脚始终延伸到底部的最佳方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19242772/

相关文章:

css - 创建重叠的 div

Javascript 文本字段值关注

javascript - GitHub 在浏览存储库时如何实现其奇特的页面删除效果?

CSS 左文本,表格居中图像

javascript - 单击/切换时更改 div 的背景

html - 无法将带有换行文本的元素居中,因为文本换行将父级设置为 100% 宽度

javascript - 使用 Jquery 更改多个 'CSS' 不起作用

css - 在某些元素 Webkit 上转换期间的模糊文本

html - 为什么无论我做什么都不能更改复选框颜色?

html - Microsoft Outlook 电子邮件边框覆盖 CSS