开发者

Webkit Scrollbars in one place, not another

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜