【问题标题】:How do I create a horizontal floating div that is always on the bottom of the page, no matter how the user scrolls?无论用户如何滚动,如何创建始终位于页面底部的水平浮动 div?
【发布时间】:2010-03-05 20:25:52
【问题描述】:

我只想要始终跨越整个页面底部的水平 div(大约 50 像素高)。怎么样?

【问题讨论】:

  • 页面底部,还是浏览器窗口底部?

标签: css templates


【解决方案1】:

在您的 CSS 中使用 position: fixed 功能。

.footer {
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    height: 50px; 
}

但是,这不适用于 IE6; check this link for a workaround.

【讨论】:

    【解决方案2】:

    看看位置:固定;我以前用它来做这个,但是你会遇到 IE 的跨浏览器错误。我最终使用了 CSS _expression() hack,以便它在 IE6/7 中工作。

    【讨论】:

      猜你喜欢
      • 2023-03-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-20
      • 2012-11-16
      • 1970-01-01
      • 1970-01-01
      • 2011-11-24
      相关资源
      最近更新 更多