CSS overscroll-behavior Property

Beginner
6 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The overscroll-behavior property controls what happens when scrolling reaches the edge of a scroll container. It can stop scroll chaining to a parent and reduce bounce or pull-to-refresh style effects.

The initial value is auto. It is a shorthand for overscroll-behavior-x and overscroll-behavior-y. One keyword sets both axes; two keywords set x then y. The element must be a scroll container (usually via overflow).

Limited availability.

Not deprecated. Standard-track CSS. MDN marks it Limited availability mainly because Safari support starts at Safari 16. Core keywords auto, contain, and none work in modern Chromium, Firefox, and Safari 16+. chain is newer — check support before relying on it. Not a runtime API.

CSS Syntax

syntax.css
overscroll-behavior: auto | contain | none | chain | [x] [y] | initial | inherit;

Property Values

ValueDescriptionTry it
autoDefault. Allows normal boundary behavior, including scroll chainingTry it
containStops scroll chaining. Local bounce effects may still happenTry it
noneStops scroll chaining and bounce / pull-style overscroll effectsTry it
chainAllows chaining, but prevents bounce. Newer keywordTry it
auto containTwo values: x then y (here x is auto, y is contain)Try it
initialResets to the initial value, autoTry it
inheritTakes the value from the parent elementTry it

How to Use overscroll-behavior

Make a scroll container first, then decide what should happen at its edge.

  1. Create a scrollable box with overflow: auto (or scroll) and a limited size.
  2. Put taller (or wider) content inside so the box can scroll.
  3. Set overscroll-behavior on that scroll container — often contain for modals and nested panels.
  4. Use one keyword for both axes, or two keywords for x then y. Prefer axis longhands when only one axis matters.
PieceRequired?Role
Scroll containerYesProperty only applies to scroll containers
Overflowing contentYes (to feel it)You need an edge to reach before chaining can start
Parent scroll areaOftenNeeded to observe chaining vs contain/none
KeywordYesChooses chaining and bounce behavior

Live Preview

Scroll the inner box to its edge, then keep scrolling. Change the keyword and compare whether the outer box moves.

Scroll the blue inner box to the end, then keep scrolling to test chaining.

Nested scroll areas

Outer scroll area

Scroll here after the inner box hits its edge. Extra outer lines make this area tall enough to move.

Inner — change overscroll-behavior

Line 1

Line 2

Line 3

Line 4

Line 5

Line 6 — keep scrolling past this edge

Outer line A

Outer line B

Outer line C

Outer line D

overscroll-behavior: contain

CSS Examples

Each snippet focuses on overscroll-behavior. Nested sizes exist only so you can reach a scroll edge. Use Try It Yourself for a live editor.

Example 1 — Stop Scroll Chaining

Keep scrolling inside a panel without dragging the page behind it.

CSS
<style>
  .panel {
    height: 120px;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid #cbd5e1;
    padding: 8px;
  }
</style>

<div class="panel">
  Scroll to the edge, then keep going.
  The page behind should stay put.
</div>
Try It Yourself

How It Works

  1. Make a scroll container. overflow: auto plus a fixed height creates a scrollable panel.
  2. Reach the edge. Scroll until no more content moves inside the panel.
  3. Apply contain. overscroll-behavior: contain stops that gesture from scrolling a parent.
  4. Local bounce may remain. Contain blocks chaining; bounce effects can still appear on some devices.

Example 2 — Stop Chaining and Bounce

Use none when you want a harder stop at the scroll boundary.

CSS
<style>
  .panel {
    height: 120px;
    overflow: auto;
    overscroll-behavior: none;
    border: 1px solid #cbd5e1;
    padding: 8px;
  }
</style>

<div class="panel">
  At the edge, neither the parent nor bounce effects should take over.
</div>
Try It Yourself

How It Works

  1. Keep the same scroll setup. You still need a scrollable box with overflowing content.
  2. Switch to none. overscroll-behavior: none blocks scroll chaining.
  3. Also reduce bounce. Unlike contain, none aims to prevent overscroll bounce / pull-style effects too.
  4. Good for overlays. Useful for dialogs and drawers where background motion feels wrong.

Example 3 — Default Chaining

With auto, scrolling past the inner edge can continue on the parent.

CSS
<style>
  .panel {
    height: 120px;
    overflow: auto;
    overscroll-behavior: auto;
    border: 1px solid #cbd5e1;
    padding: 8px;
  }
</style>

<div class="panel">
  Default behavior. After the edge, a parent may start scrolling.
</div>
Try It Yourself

How It Works

  1. Use the default keyword. auto is the initial value and keeps normal browser boundary behavior.
  2. Scroll past the edge. Once the inner box cannot move further, the gesture may continue on the outer box.
  3. That continuation is chaining. Compare this demo with contain and none in the live preview.
  4. Choose intentionally. Default is fine for simple pages; nested UI usually wants contain or none.

Edge Cases & Pitfalls

If overscroll still feels wrong, check these first.

scroll

Only works on scroll containers

Setting the property on a non-scrolling element does nothing useful by itself. Make the box scrollable with overflow first. An iframe element is not a scroll container — set it on the iframe document’s html/body instead.

modal

overflow: hidden is always “at the edge”

A box with no scrollable overflow is treated as already at its boundary. contain or none on it can still block chaining to ancestors — handy for open dialogs.

contain

contain is not the same as none

Both stop scroll chaining. none also aims to prevent bounce / pull-style effects. Pick contain when a soft bounce is acceptable.

chain

chain support is newer

chain allows chaining but blocks bounce. Prefer auto, contain, or none for broad teaching demos unless you have confirmed support.

safari

Older Safari lacks support

Support in Safari starts at version 16. On older iOS Safari, chaining and bounce may still happen even if your CSS looks correct.

Browser Support

overscroll-behavior is a browser CSS property for scroll-boundary behavior. Node.js, Deno, and Bun do not apply it.

✓ Limited availability

overscroll-behavior

auto, contain, and none: Chrome 63+, Firefox 59+, Safari 16+, Edge 18+/79+. Internet Explorer has no support. The chain keyword is newer than the core three.

86% Modern browser reach
Google Chrome 63+
Full support
Mozilla Firefox 59+
Full support
Apple Safari 16+
Full support
Microsoft Edge 18+
Full support
Opera 50+
Full support
Samsung Internet 8.2+
Full support
Internet Explorer No
No support
overscroll-behavior Limited &middot; Safari 16+

Bottom line: Safe for modern Chromium, Firefox, and Safari 16+. Treat older Safari and IE as unsupported. Prefer auto / contain / none for teaching; verify chain before shipping. Not a runtime API.

Key Takeaways

  • Role: control scroll chaining and bounce when a scroll container hits its edge.
  • Initial value: auto. Needs a scroll container to matter.
  • contain vs none: both stop chaining; none also targets bounce effects.
  • Shorthand: one value for both axes, or x then y.

One line: use contain or none on nested scroll panels so scrolling past the edge does not drag the page behind.

Frequently Asked Questions

It controls what happens when scrolling reaches the edge of a scroll container: whether scroll continues to a parent (scroll chaining) and whether bounce or pull-to-refresh style effects can run.
The initial value is auto. The browser keeps its normal boundary behavior, including scroll chaining where supported.
Scroll chaining is when you keep scrolling after hitting the edge of one scroll area and a parent scroll container (or the page) starts scrolling instead.
Use contain to stop scroll chaining while still allowing local bounce effects. Use none when you want to stop both chaining and bounce effects.
chain allows scroll chaining to continue outside the container but prevents overscroll bounce effects. Support is newer than auto, contain, and none.
auto, contain, and none work in Chrome 63+, Firefox 59+, Safari 16+, and modern Edge. MDN marks the property Limited availability mainly because older Safari versions lack it. It is a browser CSS property, not a Node.js feature.

Next: overscroll-behavior-block

Learn the logical-axis longhand for block-direction overscroll behavior.

overscroll-behavior-block tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful