全局滚动条样式设置

2020-08-26  本文已影响0人  阿凯_8b27

在项目开发中,我经常会遇到全局需要设置滚动条样式,采用如下css

::-webkit-scrollbar {
    width: 8px;
    height: 12px;
    background-color: #fff;
}

::-webkit-scrollbar-thumb {
    display: block;
    min-height: 12px;
    min-width: 8px;
    border-radius: 6px;
    background-color: rgb(217, 217, 217);
}

::-webkit-scrollbar-thumb:hover {
    display: block;
    min-height: 12px;
    min-width: 8px;
    border-radius: 6px;
    background-color: rgb(159, 159, 159);
}
上一篇 下一篇

猜你喜欢

热点阅读