The overscroll-behavior property controls what happens when a scrollable element reaches its edge. It is essential for modals, sidebars, chat panels, and any nested scroll area where you want to stop scroll chaining.
The overscroll-behavior property in CSS is used to control the behavior of scroll overflow on a webpage. It defines how the browser handles scrolling when the content reaches the end of a scrollable area.
This property is particularly useful for preventing scroll chaining, where a scroll action in one area can inadvertently scroll other areas.
Definition and Usage
Use overscroll-behavior on elements that scroll independently inside a larger page, such as modal bodies, off-canvas sidebars, dropdown panels, and nested feed lists.
Pair it with overflow: auto or overflow-y: auto so the element actually scrolls. Then set overscroll-behavior: contain to keep edge scrolling inside that box.
💡
Beginner Tip
Create a 150px-tall box with tall content and overflow: auto;. Scroll to the bottom and keep scrolling to feel scroll chaining, then add overscroll-behavior: contain;.
Foundation
📝 Syntax
The syntax for the overscroll-behavior property is as follows:
syntax.css
element{overscroll-behavior:value;}
It can be applied to any scrollable element. Here, value can be one of the predefined keywords described below.
In this example, the overscroll-behavior: contain; style prevents the parent page from scrolling when the user reaches the top or bottom of the scrollable area.
Example 2 — Default auto Behavior
With overscroll-behavior: auto, the browser keeps its normal overscroll behavior, including scroll chaining where supported.
The sidebar body scrolls independently while edge scrolling does not move the page behind the panel.
Companion
overflow vs overscroll-behavior
The overflow properties decide whether content scrolls or gets clipped inside a box. overscroll-behavior decides what happens after that box reaches its scroll boundary.
Do not trap users — Preventing scroll chaining is helpful in overlays, but ensure keyboard users can still exit modals and reach main content.
Keep nested scroll areas usable — Pair overscroll control with clear scrollable regions and sufficient contrast.
Prefer contain in dialogs — so background page movement does not disorient screen reader users.
Test touch devices — Overscroll behavior is especially noticeable on mobile swipe gestures.
🧠 How overscroll-behavior Works
1
User scrolls inside a box
A modal, sidebar, or list scrolls normally while content fits inside its bounds.
Scroll
2
Scroll reaches the edge
The inner container can scroll no farther up, down, left, or right.
Boundary
3
overscroll-behavior is applied
The browser decides whether to chain scroll, bounce, or stop at the container edge.
Value
=
🔄
Controlled overscroll
Nested panels stay isolated from the page behind them when you use contain or none.
Compatibility
Browser Compatibility
The overscroll-behavior property is widely supported in modern browsers, including the latest versions of Chrome, Firefox, Edge, and Safari. However, it’s always a good practice to test your website across different browsers to ensure consistent behavior.
✓ Baseline · Modern browsers
Strong support in current browsers
auto, contain, and none work reliably in all major evergreen browsers.
95%Global browser support
Google Chrome63+ · 2017 onward
Full support
Mozilla Firefox59+ · 2018 onward
Full support
Apple Safari16+ · macOS & iOS
Full support
Microsoft Edge18+ · Chromium Edge
Full support
Opera50+ · 2018 onward
Full support
overscroll-behavior property95% supported
Bottom line:overscroll-behavior is dependable for nested scroll UX in modern projects.
Wrap Up
Conclusion
The overscroll-behavior property is a useful tool for controlling scroll behavior on web pages, especially in complex layouts where multiple scrollable areas are present.
By using this property, you can prevent unintended scroll chaining and provide a smoother user experience. Experiment with different values to see how they affect the scrolling behavior on your site.
Use overscroll-behavior: contain on modal bodies and sidebars
Pair with overflow: auto or overflow-y: auto
Test scroll edges on touch devices and trackpads
Use none when bounce effects feel distracting
Combine with fixed overlays for cleaner nested scroll UX
❌ Don’t
Expect overscroll control without a scrollable container
Apply none everywhere when contain is enough
Confuse overscroll-behavior with overflow
Forget keyboard exit paths when locking background scroll
Skip cross-browser testing on Safari and mobile Chrome
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about overscroll-behavior
Use these points when nested scroll areas reach their edges.
5
Core concepts
🔄01
Scroll Boundaries
Control edge behavior.
Purpose
⚙02
Default auto
Browser defaults.
Default
📝03
Three Values
auto to none.
Values
🚫04
contain Panels
Stop scroll chaining.
Use case
↔05
overflow Pair
Scroll then contain.
Companion
❓ Frequently Asked Questions
overscroll-behavior controls what happens when a scrollable element reaches its scroll boundary, such as whether scroll chains to a parent or triggers bounce effects.
The default value is auto, which means the browser uses its normal overscroll behavior, including scroll chaining where supported.
Scroll chaining happens when scrolling past the edge of one scroll area continues scrolling a parent element or the page behind it.
Use contain to keep overscroll inside the element while still allowing local bounce effects. Use none when you want to disable both scroll chaining and overscroll bounce.
Yes. Modern mobile browsers support overscroll-behavior, which is especially useful for modals, drawers, and nested scroll panels on touch devices.