<分区>
<分区>
我的页面中有一个页脚,虽然它位于底部 - 它停留在屏幕底部然后固定在那里,所以如果我向下滚动它会停留在页面的一半位置。
下面是我目前拥有的,虽然我已经尝试了很多不同的东西并在谷歌上搜索了很多!!
#footer {
position: absolute;
right: 0;
bottom: 0;
left: 0;
padding: 1rem;
background-color: #00608F;
text-align: center;
}
最佳答案
你应该使用position:fixed
#footer {
position: fixed;
right: 0;
bottom: 0;
left: 0;
padding: 1rem;
background-color: #00608F;
text-align: center;
}
<footer id="footer">
Footer
</footer>
关于php - CSS - 页脚留在页面底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34200945/
相关文章:
php - yii - 为按日期排序的每个类型字段选择前五个记录
php - AJAX 悬停工具提示仅显示表中第一行的返回数据
javascript - 选择 tr 及其 "tr childs"- 查找 jquery 选择器
internet-explorer-7 - 当嵌入父容器中并溢出 :auto set 时,JQueryUI Accordion 在 IE7 中损坏
html - 为什么 Select 元素之间有一个神秘的边距?
PHP 脚本创建了一个包含 "О╩©"奇怪字符的不可预见的输出
javascript - 当我使用 lineTo 和 moveTo 绘制桨时,如何使用 Javascript 在 Breakout 中移动桨?