修改div滾動條樣式

<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;
    }

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章