问题描述:
我在页面上有一个弹框,想要弹框滚动,背景页面不动。
解决方法:
.alert-box{ position: fixed; overflow-y: scroll; width: 100%; height: 100%; top: 0; left: 0; &::-webkit-scrollbar{ display: none; }
}
上面是vue+sass的写法
在body上设置
body::-webkit-scrollbar {
display:none
}
在弹框样式上设置:
overflow-y: scroll;