html - 如果位置固定,为什么我的页脚只停留在底部
问题描述
如果我将位置设为绝对位置,它会在更大的屏幕上向上移动并在其下方留下一个空白区域。
<div class="footer">
<footer id="footer">Brought into existence by yours truly</footer>
</div>
.footer {
background-color: rgb(177, 74, 197);
text-align: center;
font-family: 'Knewave';
color: rgb(114, 245, 190);
width: 100%;
margin-bottom: 0;
bottom: 0;
left: 0;
position: fixed;
}
解决方案
您可以找到有关 w3 school的更多信息,从链接中总结绝对定位基于项目的最后一个祖先的项目位置。固定位置相对于视口的东西。
推荐阅读
- java - 关于JVM栈内存和方法重载的面试题
- npm - 运行 npm publish 没有错误,但看不到更新的包
- python - Django rest框架:CreateAPIView,存储数据的时候我要使用主键
- excel - 通过宏运行 MS Access 2016 VBA 函数,然后通过 Excel 运行该宏
- python - 数组中的 Python Numba 值
- excel - VBA - 参数不是可选的,我不明白为什么
- javascript - Ajax 数据未正确分配给具有相同类的 jQuery 输入
- java - 在Java中生成带有参数的linux命令
- sql - Teradata SQL 在粘贴到 Excel 时连接列
- javascript - bootstrap v 4.3.1 的 javascript 在 firefox v 65.0.1 中无法正常工作,有人遇到过这个问题吗?