html - 使页脚粘在页面底部的清洁方法?
问题描述
我试图让我的页脚贴在网站底部,当页面高度小于视口高度并且视口高度小于时,我还没有看到让页脚贴在底部的好答案页面高度。
解决方案
如果你想要一个粘性页脚,你可以使用position: fixed;
. 例如;
footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
width: 100%;
}
推荐阅读
- python - 限制列表中的数量并重新分配列表中的多余数量
- facebook - 使用 App Links 从 Facebook 打开 PWA(Progressive Web App)
- python - 无法计算 Tensorflow 中的准确性
- assembly - 如何将变量保存到堆栈或内存中
- spring-boot - 如何为 Riak 配置连接池
- c - 为什么我应该在 C 编程中将变量名包含在括号内?
- java - 匿名抽象类的实例化在 MainActivity 中引发错误
- angular - 尝试在 Angular 中为 Google 图表创建新的 DataTable 时无法识别 google.visialization 类
- jquery - 如何将 DateTimePicker-time-interval 添加到 DateTimePicker-inputs 作为 disabledTimeIntervals?
- azure-active-directory - 无法使用 Microsoft Graph API 获得管理员同意和访问令牌