CSS overscroll-behavior-block Property

Beginner
⏱️ 6 min read
📚 Updated: Jun 2026
🎯 4 Examples
Layout & Scrolling

What You’ll Learn

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.

01

Block Axis

Vertical in English.

02

Three Values

auto to none.

03

Default auto

Browser defaults.

04

Scroll Chaining

Stop parent scroll.

05

Nested Panels

Modals and drawers.

06

Inline Axis

Horizontal shorthand.

Introduction

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;.

📝 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.

Basic Example

overscroll-behavior-block.css
.scrollable {

  width: 300px;

  height: 150px;

  overflow: auto;

  overscroll-behavior-block: contain;

}

Syntax Rules

  • Accepted values: auto, contain, and none.
  • 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.

🎯 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.

⚡ Quick Reference

QuestionAnswer
Initial valueauto
Applies toNon-replaced block and inline elements
InheritedNo
AnimatableNo
Block axis in horizontal writingVertical (top / bottom)
Common useModal bodies, drawers, chat panels, nested vertical scroll lists

💎 Property Values

ValueExampleDescription
autooverscroll-behavior-block: auto;The default behavior; allows the browser’s default scroll chaining and overscroll behaviors on the block axis.
containoverscroll-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.
noneoverscroll-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 — default contain — stop chaining none — no bounce

👀 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

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>



<div class="scrollable">

  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit...</p>

  <p>Fusce condimentum nunc ac nisi vulputate fringilla...</p>

</div>
Try It Yourself

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.

overscroll-block-auto.css
.panel {

  max-height: 160px;

  overflow: auto;

  overscroll-behavior-block: auto;

  border: 1px solid #cbd5e1;

  border-radius: 0.5rem;

  padding: 1rem;

}
Try It Yourself

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.

overscroll-block-none.css
.feed {

  height: 180px;

  overflow: auto;

  overscroll-behavior-block: none;

  border: 1px solid #334155;

  border-radius: 0.75rem;

}
Try It Yourself

How It Works

Neither the feed nor the page responds to block-axis overscroll actions at the container edges.

Example 4 — Modal or Drawer Nested Scroll

Keep vertical scroll inside a fixed drawer or modal body with overscroll-behavior-block: contain so the page behind stays still.

drawer-scroll.css
.drawer-body {

  flex: 1;

  overflow: auto;

  overscroll-behavior-block: contain;

  padding: 1rem;

}
Try It Yourself

How It Works

The drawer body scrolls independently on the block axis while edge scrolling does not move the page behind the panel.

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;

}

♿ 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.

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 Chrome 77+ · 2019 onward
Full support
Mozilla Firefox 73+ · 2020 onward
Full support
Apple Safari 16+ · macOS & iOS
Full support
Microsoft Edge 79+ · Chromium Edge
Full support
Opera 64+ · 2019 onward
Full support
overscroll-behavior-block property 95% supported

Bottom line: overscroll-behavior-block is dependable for nested vertical scroll UX in modern projects.

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.

💡 Best Practices

✅ Do

  • 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

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
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.

Practice in the Live Editor

Open the HTML editor and experiment with overscroll-behavior-block: contain, auto, and none on nested vertical scroll areas.

HTML Editor →

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.

5 people found this page helpful