# scrollbar-width

> The `scrollbar-width` CSS property sets the width of the scrollbar, allowing customization of its appearance.

## How do I hide or make the scrollbar thinner in CSS?

The property that adjusts the width of the scrollbar. It can be set to 'auto', 'thin' or 'none', allowing for customization of scrollbar appearance and behavior, especially useful for creating cleaner and more minimalist designs.

- Topic: Client Interface
- Type: property
- Browser support: Chrome 121+, Chrome Android 121+, Edge 121+, Firefox 64+, Firefox Android 64+, Safari 18.2+, Safari iOS 18.2+

## Example

Wrong:

```css
.carousel {
  scrollbar-width: 4px;
}
```

Right:

```css
.carousel {
  scrollbar-width: thin;
}
```

`scrollbar-width` only accepts 'auto', 'thin' or 'none'; a pixel length is invalid and the declaration is ignored.

## Common mistakes

- Setting a pixel value like '8px', which is invalid and ignored.
- Hiding the scrollbar so users don't notice the area can scroll.

## Key points

- Values are the keywords 'auto', 'thin' or 'none', not pixel lengths.
- 'none' is used only where content can still be scrolled with keyboard, touch or visible controls.
- Scrollbars are hidden with `scrollbar-width: none`, not only with `::-webkit-scrollbar { display: none }`.

## Interview questions

### How do I hide the scrollbar but keep scrolling?

Set `scrollbar-width: none` on the scroll container. The content still scrolls with wheel, touch and keyboard.

### Can I set an exact scrollbar width in pixels?

No. The standard property only takes keywords; the exact size of 'thin' is chosen by the browser.

### Is scrollbar-width inherited?

No. Set it on each scroll container whose scrollbar you want to change.

## Related cards

- [scrollbar-color](https://wonderium.dev/css/scrollbar-color.md)
- [scrollbar-gutter](https://wonderium.dev/css/scrollbar-gutter.md)
- [overflow](https://wonderium.dev/css/overflow.md)
- [scrollbar](https://wonderium.dev/a11y/scrollbar.md)
- [scroll-snap-type](https://wonderium.dev/css/scroll-snap-type.md)

---

- Level: [CSS](https://wonderium.dev/css.md)
- HTML version: https://wonderium.dev/css/scrollbar-width
- Last updated: 2026-11-25
