作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在 <LeftNav>
中创建一个粘性页脚组件,到目前为止没有成功。这是需要的样子:
我试过使用 position: fixed; bottom: 0
和 position: absolute; bottom: 0
在搜索字段的包装上,但是当用户滚动列表项时,搜索字段会向上移动。像这样:
知道如何解决这个问题吗?
最佳答案
位置:固定应该工作。如果没有更多关于如何设置页面的信息,就很难更具体。看看这个 fiddle ,看看是否有帮助:
https://jsfiddle.net/kevinlrak/r1mpf1n8/
#search {
position: fixed;
background-color: red;
bottom: 0;
width: 25%;
}
关于material-ui - 如何在 LeftNav 中创建粘性页脚?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35662201/
我是一名优秀的程序员,十分优秀!