Why are there two ways to style scrollbars in CSS?▾
The ::-webkit-scrollbar pseudo-element API was introduced by WebKit before any W3C standard existed, and Chrome and Safari adopted it widely. The W3C later standardized scrollbar-color and scrollbar-width for Firefox. Edge adopted both. Currently all major browsers support one or both approaches.
Does ::-webkit-scrollbar work in Firefox?▾
No. Firefox does not implement ::-webkit-scrollbar pseudo-elements. Firefox uses the W3C standard scrollbar-color and scrollbar-width properties instead. To style scrollbars across Chrome, Safari, and Firefox, you must include both approaches in your CSS.
How do I style the scrollbar in Firefox?▾
Use scrollbar-color: thumbColor trackColor and scrollbar-width: thin, auto, or none on the scrollable element. Firefox does not support border-radius on the thumb or separate hover states. The standard properties provide basic color and width control only.
Can I make a custom scrollbar on iOS Safari?▾
iOS Safari does not support any scrollbar styling — it uses the OS overlay scrollbar that appears briefly and disappears. There is no CSS API for it. Custom scrollbars on iOS require a JavaScript-based virtual scrollbar implementation, which introduces significant complexity.
Does styling scrollbars hurt accessibility?▾
Scrollbars must remain visually distinct from surrounding content and obviously draggable. Avoid making scrollbar width less than 6px, matching thumb and track to the same color, or using a thumb that has insufficient contrast with the track. Invisible scrollbars confuse users who need them for navigation.
How do I hide the scrollbar but keep scrolling?▾
Set ::-webkit-scrollbar { display: none } for WebKit and scrollbar-width: none for Firefox. Content remains scrollable via keyboard, touch, and trackpad. Use this sparingly — hidden scrollbars remove affordance and can confuse users who do not realize the content is scrollable.
Why does my scrollbar style not show on macOS?▾
macOS defaults to hiding scrollbars unless the input device is a non-trackpad mouse. Go to System Settings → Appearance → Show scroll bars → Always to force scrollbars visible for testing. Your CSS styles are applied — they simply do not display until the OS reveals them.
What is the minimum scrollbar width that stays usable?▾
6–7px is the practical minimum for a scrollbar that can be grabbed by mouse users on non-touch devices. Below 6px the thumb becomes difficult to click and drag precisely. The thin keyword across browsers renders at approximately 6–10px depending on the platform.