我想在 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);
}
}
}
不管用。有任何想法吗?
原文由 Mati Tucci 发布,翻译遵循 CC BY-SA 4.0 许可协议
检查这个 http://codepen.io/tholman/pen/tldwm