<div class="scroll-container">
<div class="scroll-content"></div>
</div>
::scrollbar {
width: 6px;
height: 6px;
border-radius: 3px;
}
/* 滚动条滑块(里面小方块) */
::scrollbar-thumb {
border-radius: 3px;
background: rgba(0, 0, 0, 0.1);
}
/* 滚动条轨道 */
::scrollbar-track {
border-radius: 3px;
background: rgba(0, 0, 0, 0);
}
::scrollbar-track-piece {
background-color: rgba(0, 0, 0, 0);
border-radius: 0;
}
::scrollbar-thumb:hover {
background: rgba(0, 0, 0, 0.2);
}
.scroll-container {
width: 400px;
height: 200px;
overflow: auto;
}
.scroll-content {
width: 100%;
height: 400px;
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.