I'm using webkit scrollbars in a scrollable div. That's working great. However, I'd like the actual page's scrollbars to be the OS default. How can I use CSS selectors to make the webkit scrollbars only apply to the div? An e开发者_开发知识库xample: http://jsfiddle.net/zxj4m/
You apply the styles to the scrollbars like so:
::-webkit-scrollbar-thumb { ... }
Those are pseudo-selectors. To only apply them to a certain class, prepend the class name like so:
.box::-webkit-scrollbar-thumb { ... }
By leaving it blank, the browser assumes you're using the universal select (*
), which applies to every single element on the page.
精彩评论