【问题标题】:Footer, is not anchored at the bottom, Scrolling with page页脚,不固定在底部,随页面滚动
【发布时间】:2012-05-12 10:45:30
【问题描述】:

这是我的页面http://sketchedneo.com/indexex.php

所以页脚在 Include php 中

#footer {
    position: fixed;
    bottom: 0;
    z-index: 1000;
    left: 0px;
    right:0px;
    width: 100%;
    background: #c9c9c9;
    height: 125px;
    color: #868686;
    text-align: center;
    border-top: 3px solid #EBEBEB;

}

页脚需要在页面底部(如堆栈溢出)而不是随页面滚动。

请问有人知道解决方法吗?

【问题讨论】:

  • 您是否希望页脚的宽度等于浏览器或固定位置不起作用
  • 页脚需要是本网站的页脚 (stackoverflow) 所以它 100% 跨过屏幕,无论屏幕大小如何。
  • 加右:0px; - 已经工作了!谢谢
  • 你还没有在你的页面中添加位置:fixed。去修复它
  • 虽然它现在又遇到了一个问题,但页脚不是坐在底部,而是随着页面滚动。

标签: css width footer


【解决方案1】:
position:fixed;
    left: 0px; bottom:0px; right:0px; 
    background: #c9c9c9;

    color: #868686;
    border-top: 3px solid #EBEBEB;  
    text-align: center;  z-index: 1000;

这样做,而且你已经在第 1465 行第二次定义了#footer

【讨论】:

  • 页脚仍然跟随页面的滚动。
  • 那么把它从php include中去掉,放到header div上面?
  • 你在开玩笑吗,你现在给的链接有固定的页脚(在 mozilla firefox 中试试)
  • 不,即使在 Mozilla 中(我主要使用 chrome)它仍然会随页面滚动。页脚需要位于页面底部(所以只有向下滚动才能看到)
猜你喜欢
  • 1970-01-01
  • 2013-07-27
  • 1970-01-01
  • 2013-09-25
  • 2014-12-24
  • 2017-04-04
  • 2013-02-08
  • 2011-07-08
相关资源
最近更新 更多