The main properties of the scroll bar
::-webkit-scrollbar
: the whole part of the scroll bar
::-webkit-scrollbar-thumb
: the slider inside the scroll bar
::-webkit-scrollbar-track
: the track of the scroll bar
::-webkit-scrollbar-button
: Buttons at both ends of the scrollbar track, allowing fine-tuning of the slider's position by clicking
::-webkit-scrollbar-track-piece
: Inner track, the middle part of the scroll bar
::-webkit-scrollbar-corner
: the corner, and the intersection of the two scroll bars
::-webkit-resizer
: The small control at the intersection of two scroll bars used to resize elements by dragging
example
<style>
::-webkit-scrollbar {
width:12px;
height: 13px;
background-color: #000;
}
::-webkit-scrollbar-track {
background-color: #fff;
border-radius: 10px;
}
::-webkit-scrollbar-button {
background-color: #6868f3;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(8, 182, 110, 0.616);
}
::-webkit-scrollbar-thumb:hover {
background: rgba(5, 156, 93, 0.719);
-webkit-box-shadow: unset;
}
::-webkit-scrollbar-thumb:window-inactive {
background: #ff000066;
}
::-webkit-scrollbar-corner {
background-color: #f34e12;
}
</style>
Effect