【发布时间】:2016-10-27 16:41:01
【问题描述】:
我想在 Chrome 中有一个自定义滚动条。
所以,我正在使用这个 sass:
::-webkit-scrollbar {
width: 0.5em;
height: 0.5em;
}
::-webkit-scrollbar-thumb {
background-color: rgba(255,255,255,.1);
border-radius: 3px;
&:hover {
background: rgba(255,255,255,.2);
}
}
我的问题是我只想在特定的 div 中使用这种滚动条样式。但如果我这样做:
#boardslist {
::-webkit-scrollbar {
width: 0.5em;
height: 0.5em;
}
::-webkit-scrollbar-thumb {
background-color: rgba(255,255,255,.1);
border-radius: 3px;
&:hover {
background: rgba(255,255,255,.2);
}
}
}
不工作。有什么想法吗?
【问题讨论】:
-
您可以使用fakeScroll(原版轻量级脚本)更好地自定义它