Your idea was correct. However, the notation div ::-webkit-scrollbar
with a space after div
is actually the same as div *::-webkit-scrollbar
; this selector means “scrollbar of any element inside <div>
“. Use div::-webkit-scrollbar
.
See demo at http://jsfiddle.net/4xMUB/2/
More Related Contents:
- How to remove the border highlight on an input text element
- How can I write a ‘:hover’ condition for ‘a:before’ and ‘a:after’?
- Why do the :before and :after pseudo-elements require a ‘content’ property?
- CSS :after not adding content to certain elements
- Why don’t :before and :after pseudo elements work with `img` elements? [duplicate]
- What is the difference between a pseudo-class and a pseudo-element in CSS?
- Font Awesome 5, why is CSS content not showing?
- What are -moz- and -webkit-? [duplicate]
- Can I change the height of an image in CSS :before/:after pseudo-elements?
- Disable webkit’s spin buttons on input type=”number”?
- Can I target a :before or :after pseudo-element with a sibling combinator?
- Should I use single or double colon notation for pseudo-elements?
- CSS transition shorthand with multiple properties?
- CSS endless rotation animation
- Webkit backface visibility not working
- ::before pseudo-element stacking order issue
- CSS3 ::selection behaves differently in FF & Chrome
- Vertically centering content of :before/:after pseudo-elements
- Nesting pseudo-elements inside pseudo-elements
- css rotate a pseudo :after or :before content:”” [duplicate]
- Why does stacking order change on webkit filter hover?
- Change style of pseudo elements in angular2
- Can you apply a width to a :before/:after pseudo-element (content:url(image))?
- CSS “outline” different behavior behavior on Webkit & Gecko
- Wonky text anti-aliasing when rotating with webkit-transform in Chrome
- Delay mouseout/hover with CSS3 transitions
- Purpose of *:before, *:after rule without content property
- WebKit CSS content Unicode bug?
- Combine CSS Attribute and Pseudo-Element Selectors?
- using a div to blur an image behind it? [duplicate]