<div class="test test-1 scrollbar "></div>
.test{
width: 50px;
height: 200px;
overflow: auto;
float: left;
margin: 5px;
border: none;
}
.scrollbar{
width: 30px;
height: 300px;
margin: 0 auto;
}
.test-1::-webkit-scrollbar {/*滾動條整體樣式*/
width: 5px; /*高寬分別對應橫豎滾動條的尺寸*/
height: 1px;
}
.test-1::-webkit-scrollbar-thumb {/*滾動條裏面小方塊*/
border-radius: 10px;
-webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
background: #535353;
}
.test-1::-webkit-scrollbar-track {/*滾動條裏面軌道*/
-webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
border-radius: 10px;
background: #EDEDED;
}