This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The scrollbar-width
property allows the author to set the maximum thickness of an element’s scrollbars when they are shown.
Initial value | auto |
---|---|
Applies to | scrolling boxes |
Inherited | no |
Media | visual |
Computed value | as specified |
Animation type | a length |
Canonical order | per grammar |
/* Keyword values */ scrollbar-width: auto; scrollbar-width: thin; scrollbar-width: none; /* <length> values */ scrollbar-width: 1em; /* A valid length */ /* Global values */ scrollbar-width: inherit; scrollbar-width: initial; scrollbar-width: unset;
<scrollbar-width>
<length>
or a keyword. If it's a keyword, it must be one of the following values: auto | The default scrollbar width for the platform. |
thin | A thin scrollbar width variant on platforms that provide that option, or a thinner scrollbar than the default platform scrollbar width. |
none | No scrollbar shown, however the element will still be scrollable. |
Note: User Agents must apply any scrollbar-width
value set on the root element to the viewport.
auto | thin | none | <length>
.scroller { width: 300px; height: 100px; overflow-y: scroll; scrollbar-width: thin; }
<div class="scroller">Veggies es bonus vobis, proinde vos postulo essum magis kohlrabi welsh onion daikon amaranth tatsoi tomatillo melon azuki bean garlic. Gumbo beet greens corn soko endive gumbo gourd. Parsley shallot courgette tatsoi pea sprouts fava bean collard greens dandelion okra wakame tomato. Dandelion cucumber earthnut pea peanut soko zucchini.</div>
Specification | Status | Comment |
---|---|---|
CSS Scrollbars Level 1 The definition of 'scrollbar-width' in that specification. | Editor's Draft | Initial Definition |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | No | No | 63
|
No | No | No |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | No | No | No | 63
|
No | No | No |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/scrollbar-width