【发布时间】:2020-01-29 08:42:37
【问题描述】:
我想要三种不同类型的滚动条,它们的填充和边距不同。 下面是我的滚动条的全局样式:
/*
Modifying the scroll bar across the whole application
*/
/* width */
::-webkit-scrollbar {
width: 5px;
height: 5px;
}
/* Track */
::-webkit-scrollbar-track {
border-radius: 10px;
width: 5px;
height: 5px;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: #999999 !important;
border-radius: 10px;
}
::-webkit-scrollbar-track {
background: #d1d1d1 !important;
border: 1px solid #ebebeb !important;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #b30000;
}
现在我想使用类名或 id 使用具有不同填充和边距的滚动条。我不希望滚动条填充和边距影响滚动条中内容的填充和边距。如何以这种方式编写 css,为每个滚动条放置不同的填充。
【问题讨论】: