【发布时间】:2012-10-16 14:29:28
【问题描述】:
我有这个网站:http://test.tamarawobben.nl
实现页脚始终位于屏幕底部的最佳方法是什么?
【问题讨论】:
-
看看这个链接。 cssstickyfooter.com
-
如果对您有用,请不要忘记点赞并将其标记为已接受...
我有这个网站:http://test.tamarawobben.nl
实现页脚始终位于屏幕底部的最佳方法是什么?
【问题讨论】:
这取决于您所说的“始终处于底部”的含义。有两种“始终位于底部”的页脚:固定页脚和粘性页脚。
固定页脚始终位于浏览器窗口的底部,而粘性页脚始终位于页面内容或浏览器的底部底部,以较低者为准.
对于粘滞页脚,您可以查看代码on this page。对于固定页脚,您只需为其赋予以下属性:
#footer {
position: fixed;
bottom: 0px;
}
【讨论】:
页脚的 CSS
footer {
position:absolute;
bottom:0;
width:100%;
height:60px; /* Height of the footer */
background:#6cf;
}
【讨论】:
查看本教程,了解如何执行此操作 - http://matthewjamestaylor.com/blog/keeping-footers-at-the-bottom-of-the-page。
应该可以得到你想要的东西。
【讨论】: