No Login Data Private Local Save

CSS overflow Property Demo - Online Scroll & Clip Behavior

8
0
0
0

CSS overflow Property Demo

Interactive playground to explore visible, hidden, scroll, auto, and clip behaviors.

Settings
Live Metrics
Container: 300Ă—250 Content: 500Ă—400 ScrollLeft: 0px ScrollTop: 0px
Live Preview
Content Box (resize me)
Drag container bottom-right corner to resize manually (if supported)

Frequently Asked Questions

The overflow property controls what happens when content overflows an element's box. It can clip content, show scrollbars, or allow content to spill outside.

visible (default), hidden, scroll, auto, and clip. You can also set overflow-x and overflow-y independently.

Both hide overflowing content, but hidden still allows programmatic scrolling (e.g., via JavaScript scrollTo), while clip forbids any scrolling — the scroll position remains fixed at zero. Try the scroll buttons above to see the difference!

It adds scrollbars only when necessary. If content fits, no scrollbars appear; if it overflows, the browser provides scrollbars automatically.

Use it when you always want scrollbars to appear, even if content doesn't overflow. This prevents layout shifts caused by scrollbars appearing/disappearing dynamically.

No, JavaScript can still change scrollTop/scrollLeft even with hidden. To completely prevent scrolling, use overflow: clip (modern browsers).

The clip value is supported in all modern browsers (Chrome 90+, Firefox 81+, Safari 15+). In older browsers it falls back to hidden.

Use scrollbar-gutter: stable or always show scrollbars with overflow: scroll. This reserves space for scrollbars even when not needed.