Overscroll Behavior Property

Last updated: 2026-09-13

overscroll-behavior Overscroll Behavior Property

The overscroll-behavior property controls what happens when a scrolling container reaches its boundary — for example, whether the scroll event passes to the parent container (scroll chaining) or triggers a browser default like page refresh or history navigation. It is a key property for solving the scroll-penetration problem in nested scrolling containers.

Category
Initial Valueauto
InheritedNo
Applies To
Animation Type
CSS VersionCSS3
StatusStandard

📝 Syntax

overscroll-behavior: contain | none | auto;

⚙️ Values

ValueTypeDescription
contain | none | autoKeywordThe behavior at the scroll boundary

▶ Example

Edit the code below and see the live result in the playground:

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
overscroll-behavior v57 v12 v52 v10.1 v44
Supported in all major browsers
Tip: contain blocks scroll chaining, so scrolling to the boundary inside the container no longer moves the outer container; none additionally blocks browser default boundary behaviors such as iOS rubber-banding.
Tip: For modals, sidebars, and floating panels with nested scrolling, overscroll-behavior: contain is recommended so users do not accidentally scroll the page behind.

❓ FAQ

QWhat is the difference between overscroll-behavior and touch-action?
Aoverscroll-behavior controls how the scroll chain propagates after reaching the boundary — whether it moves the outer container or triggers browser behaviors like refresh and rebound. touch-action controls how the browser interprets touch gestures — whether panning, zooming, or double-tap zoom are allowed. The former targets what happens when you scroll past the edge; the latter targets how gestures are interpreted. They solve different problems.
QWhy does the page still scroll even though I set overscroll-behavior: contain?
Aoverscroll-behavior only acts on scroll chaining: when an inner container reaches its boundary and tries to hand the scroll to the outer layer, contain intercepts that handoff. If the scroll event never comes from the scrolling container, or the outer page itself is being scrolled by the finger on mobile, contain does nothing. Also confirm the property is set on the container that actually scrolls.
QWhat is scroll chaining, and how do I stop scroll penetration?
AScroll chaining means that after an inner element scrolls to its boundary, the scroll continues and passes to the parent or the page — the classic scrolling-inside-a-modal-also-scrolls-the-page penetration. Set overscroll-behavior: contain on the content container of the modal, sidebar, or drawer to intercept the pass-through; none additionally disables browser defaults like pull-to-refresh and rebound.
QWhat is the relationship between overscroll-behavior and overscroll-behavior-x/y?
Aoverscroll-behavior is the shorthand that sets the boundary behavior for both axes at once; overscroll-behavior-x and overscroll-behavior-y are the longhands for the horizontal and vertical directions. For example, to block scroll chaining only vertically, write overscroll-behavior-y: contain.

📚 Related Tutorials

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏