评论内容部分实现滚动,高度自适应
1,首先设置body 不能滚动 overflow: hidden;height: 100%;
2 .滚动位置设置绝对定位,并设计上下左右的距离
height: auto;
overflow: scroll;
position: absolute;
width: 100%;
bottom: 1rem;
z-index: -1;
top: 6.4rem;
left: 0;
padding: 0 .3rem;
3.去掉滚动条自带滚动栏
::-webkit-scrollbar{
display: none
}
参考知乎的一篇文章
https://zhuanlan.zhihu.com/p/24125823
移动端内滚动高度自适应
最新推荐文章于 2023-02-27 11:59:22 发布