CSS overscroll-behavior-block Property

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

Definition and Usage

The overscroll-behavior-block property sets what the browser does when scrolling hits the block-axis edge of a scroll container. In horizontal writing modes such as English, the block axis is vertical: top and bottom edges.

Use it on nested panels, modal bodies, and drawers so vertical overscroll does not move the page behind them. Pair it with overflow: auto or overflow-y: auto. For both axes at once, use overscroll-behavior.

Limited availability.

Not deprecated and not experimental, but MDN marks it Limited availability: Safari support starts at 16, and the newer chain value is missing in Safari and older Chromium/Firefox builds.

CSS Syntax

syntax.css
overscroll-behavior-block: auto | contain | none | chain | initial | inherit;

Property Values

ValueDescriptionTry it
autoDefault. Allows normal overscroll and scroll chaining on the block axisTry it
containStops scroll chaining. Local bounce may still occurTry it
noneStops scroll chaining and disables overscroll bounceTry it
chainAllows chaining, but blocks bounce. Limited availabilityTry it
initialSets this property to its default value, autoTry it
inheritInherits this property from the parent elementTry it

How to Use overscroll-behavior-block

Make a scrollable box, then decide what happens when the user reaches its block-axis edge.

  1. Give the element a fixed size and make it scroll with overflow: auto or overflow-y: auto.
  2. Put content taller than the box so a vertical scrollbar appears (in horizontal writing).
  3. Set overscroll-behavior-block on that same scroll container. It is not inherited.
  4. Choose contain for most modals and drawers, or none when bounce must also stop.
PieceRequired?Role
Scroll containerYesNeeds overflow and content that can scroll on the block axis
KeywordYesauto, contain, none, or chain
Parent scroll areaFor demosNeeded to feel scroll chaining when the value is auto

Live Preview

Scroll the yellow panel to its top or bottom, then keep scrolling. Change the value and compare how the outer dashed area reacts.

Inner panel scrolls first. Extra scroll at the edge may move the outer stage when the value allows chaining.

Nested scroll

Inner panel — scroll me first.

Keep going until you hit the top or bottom edge.

Then continue scrolling to test chaining.

The outer dashed box only moves if chaining is allowed.

End of the inner content.

overscroll-behavior-block: contain

CSS Examples

Each snippet adds only what overscroll-behavior-block needs: a scrollable box and a keyword. Use Try It Yourself for a live editor.

Example 1 — Contain Block-Axis Chaining

Stop the page behind a nested panel from scrolling when the panel hits its top or bottom edge.

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

<div class="panel">
  <p>Line 1 — scroll inside this box.</p>
  <p>Line 2 — keep going to the edge.</p>
  <p>Line 3 — extra scroll stays here.</p>
  <p>Line 4 — the page behind does not move.</p>
</div>
Try It Yourself

How It Works

  1. Make the box scroll. height: 120px plus overflow: auto creates a vertical scroll area.
  2. Fill past the height. Four paragraphs are taller than 120px, so the panel can reach a top and bottom edge.
  3. Contain the overscroll. overscroll-behavior-block: contain stops that edge scroll from chaining to a parent.
  4. Bounce may remain. Local bounce can still appear. Use none if you need that gone too.

Example 2 — Disable Chaining and Bounce

Use none when block-axis bounce or pull-to-refresh should not fire from a nested list.

CSS
<style>
  .feed {
    height: 140px;
    overflow: auto;
    overscroll-behavior-block: none;
    border: 1px solid #ccc;
  }
</style>

<div class="feed">
  <p>Update 1</p>
  <p>Update 2</p>
  <p>Update 3</p>
  <p>Update 4</p>
  <p>Update 5</p>
</div>
Try It Yourself

How It Works

  1. Same scroll setup. A fixed height and overflow: auto make the feed a scroll container.
  2. Reach the block edge. Scrolling past the last or first item hits the top or bottom boundary.
  3. Turn off both effects. none stops chaining to parents and also blocks overscroll bounce.
  4. Mobile tip. This is the usual choice when a nested panel should not trigger pull-to-refresh.

Example 3 — Drawer Body

Keep vertical scroll inside a drawer body so the page behind stays still.

CSS
<style>
  .drawer-body {
    height: 140px;
    overflow: auto;
    overscroll-behavior-block: contain;
  }
</style>

<aside class="drawer">
  <h2>Settings</h2>
  <div class="drawer-body">
    <p>Profile</p>
    <p>Notifications</p>
    <p>Privacy</p>
    <p>Security</p>
    <p>Billing</p>
  </div>
</aside>
Try It Yourself

How It Works

  1. Scroll only the body. The header stays fixed. The body gets overflow: auto.
  2. Contain vertical overscroll. overscroll-behavior-block: contain keeps edge scrolling inside the drawer.
  3. Leave the page alone. Gestures at the top or bottom of the list do not move the document behind the panel.
  4. Keep exit paths. Overscroll control is not focus trapping. Keyboard users still need a clear way to close the drawer.

Edge Cases & Pitfalls

If overscroll still moves the page, one of these is usually why.

overflow

It only applies to scroll containers

Without overflow that can scroll, the property has nothing to control. Set overflow: auto or overflow-y: auto on the same element.

axis

Block is not always vertical

With writing-mode: vertical-rl, the block axis is horizontal. Prefer overscroll-behavior-y when you mean physical top and bottom every time.

chain

chain is newer

chain allows scroll chaining without bounce, but support is Limited availability. Prefer contain or none for production UIs today.

hidden

overflow: hidden is always at its edge

A box with no scrollable overflow is treated as already at its scroll boundary. Setting contain or none on it can still stop chaining to parents — useful for overlays.

shorthand

Do not confuse with the shorthand

overscroll-behavior sets both axes. This longhand only affects the block axis. Use overscroll-behavior-inline for the other axis.

Browser Support

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

✓ Limited availability · Safari 16+

overscroll-behavior-block

auto, contain, and none: Chrome 77+, Firefox 73+, Safari 16+, Edge 79+. chain: Chrome 150+, Firefox 157+, Edge 150+; not in Safari.

96% auto / contain / none
Google Chrome 77+ · chain in 150+
Full support
Mozilla Firefox 73+ · chain in 157+
Full support
Apple Safari 16+ · no chain
Partial
Microsoft Edge 79+ · chain in 150+
Full support
Opera 64+ · chain in 134+
Full support
Samsung Internet 12+
Full support
Internet Explorer Not supported
Not supported
overscroll-behavior-block Widely supported (core values)

Bottom line: Safe for auto, contain, and none in current evergreen browsers and Safari 16+. Treat chain as Limited availability. Internet Explorer has no support.

Key Takeaways

  • Role: control overscroll at the block-axis edge of a scroll container.
  • Common pick: contain for modals and drawers; none when bounce must stop too.
  • Logical axis: vertical in English; follows writing-mode.
  • Initial value: auto. Not inherited. Needs a scroll container.

One line: overscroll-behavior-block decides whether block-axis overscroll chains out of a nested scroll box.

Frequently Asked Questions

It controls what happens when scrolling reaches the block-axis edge of a scroll container. In horizontal writing modes such as English, that edge is the top or bottom.
Scroll chaining is when scrolling past the edge of one box continues scrolling a parent or the page behind it. contain and none stop that on the block axis.
Use contain to stop block-axis scroll chaining while still allowing local bounce. Use none when you also want to disable bounce and actions like pull-to-refresh.
overscroll-behavior-block follows writing mode: vertical in horizontal writing, horizontal in vertical writing. overscroll-behavior-y always targets the physical vertical axis.
No. Set it on the scroll container itself. The initial value is auto.
Chrome 77+, Firefox 73+, Safari 16+, and Edge 79+ support auto, contain, and none. The newer chain value needs Chrome 150+, Firefox 157+, or Edge 150+, and Safari does not support it yet. It is a browser CSS property, not a Node.js feature.

Next: overscroll-behavior-inline

Control overscroll on the inline axis for side-scrolling panels.

overscroll-behavior-inline 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