I've been experimenting with styling my scrollbars using CSS properties, like those described at https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Scrollbars. Interestingly, when I apply these properties directly to the body element with code like body { ... }
, they don't seem to take effect. For example:
body {
scrollbar-color: rebeccapurple green;
scrollbar-width: thin;
}
<div style="height: 10000px"></div>
However, if I use a wildcard selector instead, the styles do work:
* {
scrollbar-color: rebeccapurple green;
scrollbar-width: thin;
}
<div style="height: 10000px"></div>
Can anyone explain why this difference occurs? By the way, I'm using the latest version of Firefox on MacOS. Could this be a bug?