Web page custom scroll bar style
The basic code is as follows
<div class="content">
<div class="contentHeight"></div>
</div>
.content {
width: 300px;
height: 300px;
overflow: hidden;
overflow-y: scroll;
background-color: #00FFFF;
border: 1px solid #000;
}
.contentHeight {
width: 500px;
height: 500px;
}
::-webkit-scrollbar The whole part of the scroll bar, the width can be set |
::-webkit-scrollbar-button Buttons at both ends of the scrollbar |
::-webkit-scrollbar-track outer track |
::-webkit-scrollbar-track-piece inner scroll bar |
::-webkit-scrollbar-thumb scroll bar |
::-webkit-scrollbar-corner corner |
::-webkit-resizer defines the style of the drag block in the lower right corner |
.content::-webkit-scrollbar {
height: 50px;
width: 5px;
}
.content::-webkit-scrollbar-thumb {
border-radius: 5px;
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
background: #535353;
}
.content::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
border-radius: 5px;
background: #fff;
}
.content::-webkit-scrollbar-button{
width: 6px;
height: 6px;
background-color: red;
}