css 修改谷歌預設滾動條樣式
阿新 • • 發佈:2021-01-18
直接上程式碼:
/*滾動條整體部分,必須要設定*/
::-webkit-scrollbar{
width: 8px;
height: 8px;
background-color: transparent;
}
/*滾動條的軌道*/
::-webkit-scrollbar-track{
background-color: transparent;
}
/*滾動條的滑塊按鈕*/
::-webkit-scrollbar-thumb{
border-radius: 10px;
background-color: rgb(7,61,92);
box-shadow : inset 0 0 5px rgb(7,61,92);
}
/*滾動條的上下兩端的按鈕*/
::-webkit-scrollbar-button{
height: 0;
background-color: rgb(7,61,92);
}
// 兩個滾動條的交匯處
::-webkit-scrollbar-corner{
background-color: transparent;
}
實現效果: