直接上代码,根据需求修改就行
/* 滚动条样式 content为包裹内容的容器类名 */
.contentbox {
overflow-y: auto;
height: 100%;
width: 100%;
}
.contentbox::-webkit-scrollbar-track {
/*滚动条里面轨道*/
box-shadow: inset 0 0 2px rgba(255, 255, 255, 0.2);
border-radius: 6px;
background: rgba(255, 255, 255, 0.1);
}
.contentbox::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 6px;
box-shadow: inset 0 0 4px rgba(144, 147, 153, 0.2);
background: rgba(144, 147, 153, 0.2);
}
.contentbox::-webkit-scrollbar {
/*滚动条整体样式*/
width: 6px;
height: 1px;
}