【问题标题】:What's the best way to take care that the footer will always be on the bottom确保页脚始终位于底部的最佳方法是什么
【发布时间】:2012-10-16 14:29:28
【问题描述】:

我有这个网站:http://test.tamarawobben.nl

实现页脚始终位于屏幕底部的最佳方法是什么?

【问题讨论】:

  • 看看这个链接。 cssstickyfooter.com
  • 如果对您有用,请不要忘记点赞并将其标记为已接受...

标签: html css styles footer


【解决方案1】:

这取决于您所说的“始终处于底部”的含义。有两种“始终位于底部”的页脚:固定页脚和粘性页脚。

固定页脚始终位于浏览器窗口的底部,而粘性页脚始终位于页面内容或浏览器的底部底部,以较低者为准.

对于粘滞页脚,您可以查看代码on this page。对于固定页脚,您只需为其赋予以下属性:

#footer {
    position: fixed;
    bottom: 0px;
}

【讨论】:

    【解决方案2】:

    页脚的 CSS

    footer {
       position:absolute;
       bottom:0;
       width:100%;
       height:60px;   /* Height of the footer */
       background:#6cf;
    }
    

    关于此的完整文章:How to keep footers at the bottom of the page

    【讨论】:

      【解决方案3】:

      查看本教程,了解如何执行此操作 - http://matthewjamestaylor.com/blog/keeping-footers-at-the-bottom-of-the-page

      应该可以得到你想要的东西。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-01-26
        • 2011-11-24
        • 2012-12-13
        • 2020-12-05
        • 2021-10-08
        • 1970-01-01
        • 2012-11-16
        • 2020-11-30
        相关资源
        最近更新 更多