← All notes

CSS overflow: clip, scroll, and style the scrollbar

Answer: When content extends beyond its parent, there are many options for handling it.

Scrollbar properties

Style the scrollbar to incorporate it into your site's design.

Use the scrollbar-width and scrollbar-color properties to style scrollbars.

To change the width of the scrollbar, use scrollbar-width.

auto is the default scrollbar width as provided by the platform.

scrollbar-color sets the color for the scrollbar's thumb and gutter.

Overflow options

You can scroll to add additional space.

The overflow properties will help control overflow in the box model.

You can clip the overflowing edges.

text-overflow will help with individual lines of text.

You can indicate the cut-off with an ellipsis.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: web.dev, Overflow; Chrome for Developers, Scrollbar styling. CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0. CC-BY-4.0 (https://developers.google.com/site-policies). Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License. Copyright Google LLC. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: web.dev, Overflow; Chrome for Developers, Scrollbar styling. CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0. CC-BY-4.0 (https://developers.google.com/site-policies). Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License. Copyright Google LLC.

Cite this

Permanent ID: iil:note:drc6g1t1

iinventedlight. 2026. "CSS overflow: clip, scroll, and style the scrollbar." iinventedlight Library, iil:note:drc6g1t1, version of 2026-11-24. https://iinventedlight.com/library/notes/css-overflow/. License: CC-BY-4.0.

@misc{iil_note_drc6g1t1,
  author = {{iinventedlight}},
  title = {{CSS overflow: clip, scroll, and style the scrollbar}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-24},
  url = {https://iinventedlight.com/library/notes/css-overflow/},
  note = {Permanent ID iil:note:drc6g1t1. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/css-overflow.md.