一、全局滚动条样式设置:
::-webkit-scrollbar {
width: 4px;
height: 4px;
}
::-webkit-scrollbar-thumb {
border-radius: 5px;
-webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
background-color: #99a9bf;
}
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
border-radius: 5px;
background-color: #d3dce6;
}
二、单独滚动条样式设置
.container {
max-height: 100vh;
overflow-y: scroll;
&::-webkit-scrollbar {
width: 4px;
height: 4px;
}
&::-webkit-scrollbar-thumb {
border-radius: 5px;
-webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
background-color: #99a9bf;
}
&::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
border-radius: 5px;
background-color: #d3dce6;
}
}
原文地址https://blog.csdn.net/Fansr_/article/details/119784638