最佳答案
我对以双冒号作为前缀的伪元素还是个新手。我偶然看到一篇博客文章,讨论使用 webkit 的 css 来设计滚动条的样式。伪元素 CSS 可以应用于单个元素吗?
/* This works by applying style to all scroll bars in window */
::-webkit-scrollbar {
width: 12px;
}
/* This does not apply the scrollbar to anything */
div ::-webkit-scrollbar {
width: 12px;
}
在这里,我希望对 div 的滚动条进行自定义,但是主窗口的滚动条保持默认状态。