css - 如何在css3中将填充/边距设置为页脚
问题描述
滚动时我无法查看我的内容,因为粘性页脚隐藏了内容。我想始终将页脚设置为边缘顶部或填充顶部以能够看到内容。如何将页边距顶部或填充顶部设置为粘性页脚?如果我添加stickyfooter,我需要在内容和stickyfooter 之间留一些空间。
http://jsfiddle.net/a6c8rf4y/1/
#footer
{
bottom:0px;
width:100%;
height:50px;
position:fixed;
height: 50px;
line-height: 50px;
background-color: #C97;
}
解决方案
通过添加
.content {
margin-bottom: 50px;
}
在您的 CSS 中,您的内容会在底部留出足够的空间,以便在用户一直向下滚动时让您的粘滞页脚适应。
推荐阅读
- c++ - 没有要调用的匹配函数(字符串错误)
- flutter - 在 Flutter 的 PageView 模块中没有正确设置 PageController。弹出职位非空错误
- firebase - Firestore 如何从文档快照流中的快照访问值
- mysql - MySQL 选择表头联合查询结果给出错误代码:1250。来自 SELECT 之一的表不能用于全局 ORDER 子句
- html - 试图在 Google 表格上抓取一些数据,但被 XPath 击败
- kdb - 如何在 kdb 控制台中显示 unicode char
- react-navigation-stack - react-navigation 5:深度嵌套堆栈导航器的后退按钮行为应该是什么
- arrays - 使用 jq 为 json 对象中的每个数组元素生成一行输出,该对象还包括 json 对象中的其他字段
- c# - '<>c.<>9' 是什么意思?我找不到它们的任何声明,它们来自哪里?
- python-3.x - 无法让这个 selenium web 驱动程序等待。但我可以让它睡觉,为什么?