【问题标题】:How do you create a bar at the bottom of the browser that is persistent?如何在浏览器底部创建一个持久的栏?
【发布时间】:2011-01-04 17:47:07
【问题描述】:

什么 HTML/CSS 用于创建填充浏览器底部并在用户滚动时保持原位的栏?请参阅 envato.com 了解我在说什么。

【问题讨论】:

  • 提问前先搜索。重复:stackoverflow.com/questions/42294/…
  • 我进行了搜索,也许我只是“搜索挑战”,但我只找到了确保当页面没有填满整个屏幕时页脚保持在底部的东西。下次我会更努力的。

标签: css footer sticky-footer


【解决方案1】:

这个方法我以前用过,效果不错。

http://ryanfait.com/sticky-footer/

* {
    margin: 0;
}
html, body {
    height: 100%;
}
.wrapper {
    min-height: 100%;
    height: auto !important;
    height: 100%;
    margin: 0 auto -142px; /* the bottom margin is the negative value of the footer's height */
}
.footer, .push {
    height: 142px; /* .push must be the same height as .footer */
}

【讨论】:

  • 太棒了!像魅力一样工作!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-01-26
  • 2022-12-07
  • 1970-01-01
  • 2013-05-14
  • 2012-02-29
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多