滚动条样式

/* 针对 WebKit 浏览器(如 Chrome, Safari) */
::-webkit-scrollbar {
    width: 12px; /* 设置滚动条宽度 */
    height: 12px; /* 设置滚动条高度 */
}
 
::-webkit-scrollbar-thumb {
    background-color: darkgrey; /* 设置滚动条滑块颜色 */
    border-radius: 10px; /* 设置滑块圆角 */
    border: 2px solid #ffffff; /* 设置滑块边框 */
}
 
::-webkit-scrollbar-track {
    background: #f1f1f1; /* 设置滚动条轨道颜色 */
}
 
/* 针对 Firefox */
html {
    scrollbar-width: thin; /* 设置滚动条宽度为 thin 或 auto、none */
    scrollbar-color: darkgrey lightgrey; /* 设置滑块和轨道颜色 */
}

 

posted @ 2025-03-26 09:31  牧夫座  阅读(13)  评论(0)    收藏  举报