Nossos voluntários ainda não traduziram este artigo para o Português (do Brasil). Junte-se a nós e ajude-nos a fazer o trabalho!
Você também pode ler o artigo em English (US).

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 valueauto
Applies toscrolling boxes
Inheritedno
Mediavisual
Computed valueas specified
Animation typediscrete
Canonical orderper grammar

Syntax

/* Keyword values */
scrollbar-width: auto;
scrollbar-width: thin;
scrollbar-width: none;

/* Global values */
scrollbar-width: inherit;
scrollbar-width: initial;
scrollbar-width: unset;

Values

<scrollbar-width>
Defines the width of the scrollbar either as a length or as a keyword. If a keyword is used, 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: The length value for scrollbar-width is at risk of being dropped from the specification, as is the scrollbar-width property itself. (Issue 1958)

Note: User Agents must apply any scrollbar-width value set on the root element to the viewport.

Formal syntax

auto | thin | none

Example

CSS

.scroller {
  width: 300px;
  height: 100px;
  overflow-y: scroll;
  scrollbar-width: thin;
}

HTML

<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>

Result

Specifications

Specification Status Comment
CSS Scrollbars Level 1
The definition of 'scrollbar-width' in that specification.
Working Draft Initial Definition

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
scrollbar-width
Experimental
Chrome No support NoEdge No support NoFirefox Full support 64
Full support 64
Full support 63
Disabled
Disabled From version 63: this feature is behind the layout.css.scrollbar-width.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile No support NoFirefox Android Full support 64
Full support 64
Full support 63
Disabled
Disabled From version 63: this feature is behind the layout.css.scrollbar-width.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No

Legend

Full support  
Full support
No support  
No support
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
User must explicitly enable this feature.
User must explicitly enable this feature.

Etiquetas do documento e colaboradores

Última atualização por: mdnwebdocs-bot,