The overscroll-behavior-block property controls what happens when a scrollable element reaches its block-axis edge. In horizontal writing mode, that means vertical scrolling — essential for modals, drawers, chat panels, and nested scroll areas.
The overscroll-behavior-block property in CSS controls the behavior of the browser when the user scrolls to the edge of a block-level element along the block axis.
It allows developers to define what happens when a user attempts to scroll beyond the boundaries of an element, providing a way to manage the default “bounce” or “scroll chaining” behavior seen in many browsers and devices.
This property is particularly useful for improving user experience in scrollable areas and preventing undesired scrolling interactions.
Definition and Usage
In horizontal writing modes such as English, the block axis runs top to bottom, so overscroll-behavior-block controls vertical overscroll behavior. Use it on elements that scroll independently inside a larger page, such as modal bodies, off-canvas drawers, dropdown panels, and nested feed lists.
Pair it with overflow: auto or overflow-y: auto so the element actually scrolls on the block axis. Then set overscroll-behavior-block: contain to keep vertical edge scrolling inside that box.
The overscroll-behavior shorthand sets both block and inline axes at once. Use overscroll-behavior-inline when you need to control horizontal overscroll separately.
💡
Beginner Tip
Create a 150px-tall box with tall content and overflow: auto;. Scroll to the bottom and keep scrolling to feel vertical scroll chaining, then add overscroll-behavior-block: contain;.
Foundation
📝 Syntax
The syntax for the overscroll-behavior-block property is as follows:
syntax.css
element{overscroll-behavior-block:value;}
It can be applied to any scrollable element. Here, value can be one of the predefined keywords described below.
The element must be scrollable, usually with overflow: auto or overflow-y: auto.
overscroll-behavior is a shorthand for overscroll-behavior-block and overscroll-behavior-inline.
In horizontal writing mode, the block axis maps to vertical scrolling (top and bottom edges).
contain is the most common choice for modal bodies, drawers, and nested panels.
Defaults
🎯 Default Value
The default value of the overscroll-behavior-block property is auto, which allows the default overscroll behavior, such as scrolling or bounce effects, to occur on the block axis.
With auto, scrolling past the top or bottom edge of a nested scroll area may chain to the page behind it or trigger platform-specific bounce effects.
The default behavior; allows the browser’s default scroll chaining and overscroll behaviors on the block axis.
contain
overscroll-behavior-block: contain;
Prevents scroll chaining by containing the scroll within the element on the block axis. It stops the propagation of vertical scroll to parent elements.
none
overscroll-behavior-block: none;
Disables overscroll behavior and prevents scroll chaining on the block axis. This setting can help prevent the user from inadvertently triggering actions like page refresh on mobile browsers when overscrolling.
auto — defaultcontain — stop chainingnone — no bounce
Preview
👀 Live Preview
Three scroll boxes with the same tall gradient content and different overscroll-behavior-block values. Scroll each box to its top or bottom edge on the block axis:
auto
contain
none
Hands-On
Examples Gallery
Contain vertical scroll chaining with contain, compare default auto behavior, disable block-axis bounce with none, and isolate scroll inside a modal or drawer body.
🔄 Block-Axis Containment
Use overscroll-behavior-block: contain when nested scroll areas should not scroll the page behind them on the vertical axis.
Example 1 — Scrollable Container with contain
In this example, we demonstrate how to use the overscroll-behavior-block property to contain the scrolling behavior within an element.
overscroll-block-contain.html
<style>.scrollable{width:300px;height:150px;overflow:auto;border:1px solid #ccc;overscroll-behavior-block:contain;}</style><divclass="scrollable"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit...</p><p>Fusce condimentum nunc ac nisi vulputate fringilla...</p></div>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus luctus urna sed urna ultricies ac tempor dui sagittis.
Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
How It Works
In this example, the overscroll-behavior-block: contain; style prevents the parent page from scrolling when the user reaches the top or bottom of the scrollable area on the block axis.
Example 2 — Default auto Behavior
With overscroll-behavior-block: auto, the browser keeps its normal block-axis overscroll behavior, including scroll chaining where supported.
Section two — keep reading until you reach the bottom edge.
Section three — at the edge, extra scroll may move the page.
Section four — that is normal default browser behavior.
How It Works
When the panel hits its block-axis scroll boundary, the browser may pass the vertical scroll gesture to the page behind it.
🚫 Bounce & Nested UI
Disable block-axis bounce with none or isolate vertical scroll inside modal and drawer layouts.
Example 3 — Disable Block-Axis Chaining and Bounce with none
Use overscroll-behavior-block: none when you want to stop both vertical scroll chaining and block-axis overscroll bounce effects. On mobile, this can also help prevent pull-to-refresh when overscrolling at the top of a nested panel.
The drawer body scrolls independently on the block axis while edge scrolling does not move the page behind the panel.
Companion
overscroll-behavior vs block vs inline
The overscroll-behavior shorthand sets both axes at once. overscroll-behavior-block targets only the block axis (vertical in horizontal writing), and overscroll-behavior-inline targets only the inline axis (horizontal in horizontal writing).
scroll-companion.css
/* Shorthand — both axes */.modal-body{overscroll-behavior:contain;}/* Block axis only — vertical in horizontal writing */.drawer-body{overscroll-behavior-block:contain;overscroll-behavior-inline:auto;}
A11y
♿ Accessibility
Do not trap users — Preventing block-axis 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 — Block-axis overscroll behavior is especially noticeable on mobile swipe gestures and pull-to-refresh.
🧠 How overscroll-behavior-block Works
1
User scrolls on the block axis
A modal, drawer, or list scrolls vertically in horizontal writing while content fits inside its bounds.
Scroll
2
Scroll reaches the top or bottom edge
The inner container can scroll no farther up or down on the block axis.
Boundary
3
overscroll-behavior-block is applied
The browser decides whether to chain vertical scroll, bounce, or stop at the container edge.
Value
=
🔄
Controlled block-axis overscroll
Nested panels stay isolated from the page behind them when you use contain or none on the block axis.
Compatibility
Browser Compatibility
The overscroll-behavior-block property is supported in most modern browsers. However, for the best user experience, it’s recommended to test this property across different browsers and devices 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 Chrome77+ · 2019 onward
Full support
Mozilla Firefox73+ · 2020 onward
Full support
Apple Safari16+ · macOS & iOS
Full support
Microsoft Edge79+ · Chromium Edge
Full support
Opera64+ · 2019 onward
Full support
overscroll-behavior-block property95% supported
Bottom line:overscroll-behavior-block is dependable for nested vertical scroll UX in modern projects.
Wrap Up
Conclusion
The overscroll-behavior-block property provides a useful way to manage scrolling behavior within block-level elements along the block axis.
By controlling overscroll actions, developers can create smoother and more controlled user experiences, especially in scrollable containers. This property is particularly valuable for preventing unintended interactions like overscroll bounce effects or unwanted scrolling in parent containers. Experiment with different values to find the best solution for your web design needs.
Use overscroll-behavior-block: contain on modal bodies and drawers
Pair with overflow: auto or overflow-y: auto
Test block-axis scroll edges on touch devices and trackpads
Use none when vertical bounce or pull-to-refresh feels distracting
Use the shorthand when both axes need the same value
❌ Don’t
Expect overscroll control without a scrollable container
Apply none everywhere when contain is enough
Confuse overscroll-behavior-block with overflow-y
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-block
Use these points when nested scroll areas reach their block-axis edges.
5
Core concepts
🔄01
Block Axis
Vertical in English.
Purpose
⚙02
Default auto
Browser defaults.
Default
📝03
Three Values
auto to none.
Values
🚫04
contain Panels
Stop vertical chaining.
Use case
↔05
Shorthand Pair
Block + inline axes.
Companion
❓ Frequently Asked Questions
overscroll-behavior-block controls what happens when a scrollable element reaches its block-axis boundary, such as whether vertical scroll chains to a parent or triggers bounce effects. In horizontal writing mode, the block axis is vertical.
The default value is auto, which means the browser uses its normal overscroll behavior on the block axis, including scroll chaining where supported.
overscroll-behavior-block targets the block axis (vertical in horizontal writing), while overscroll-behavior-inline targets the inline axis (horizontal in horizontal writing). The overscroll-behavior shorthand sets both at once.
Use contain to stop vertical scroll chaining while still allowing local bounce effects. Use none when you also want to disable block-axis bounce and actions like pull-to-refresh on mobile.
Yes. Modern mobile browsers support overscroll-behavior-block, which is especially useful for modals, drawers, and nested scroll panels where vertical overscroll should not move the page behind.