I'm trying to style the track of the scroll bar. Whenever I style the track:
div::-webkit-scrollbar-track {
background-color: blue;
}
Nothing changes.
Whenever I style the scrollbar:
div::-webkit-scrollbar {
background-color: blue;
}
The entire scroll bar is blue, no visible thumb
What am I missing here?
Edit:
I'm working in Chrome. What's odd is that the scroll bars in all my overflow containers just started showing up. Before they were invisible and the scroll thumb would only appear when hover or scrolling (can't remember which, but it definitely wasn't always there). Firefox seems to be giving the desired behavior.
Did something change with Chrome scrollbars lately?
I know this thread is a few years old but I want to add a general answer to why it wasn't working. From my experience
you always have to set at least some attribute (like e.g. the background-color
) of the whole ::-webkit-scrollbar
{ }
to be able to edit the ::-webkit-scrollbar-thumb
{ }
and other parts of the scrollbar.
Hope this increases the general understanding.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With