CSS overscroll-behavior-y Property

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

Definition and Usage

The overscroll-behavior-y property sets what the browser does when scrolling hits the physical vertical edge of a scroll container — top and bottom. Unlike the logical longhands, it does not flip with writing-mode.

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

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-y: auto | contain | none | chain | initial | inherit;

Property Values

ValueDescriptionTry it
autoDefault. Allows normal overscroll and scroll chaining on the Y 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-y

Make a vertically scrollable box, then decide what happens when the user reaches its top or bottom edge.

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

Live Preview

Scroll the white 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 vertical 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-y: contain

CSS Examples

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

Example 1 — Contain Vertical 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-y: auto;
    overscroll-behavior-y: 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-y: 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-y: 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 vertical bounce or pull-to-refresh should not fire from a nested list.

CSS
<style>
  .feed {
    height: 140px;
    overflow-y: auto;
    overscroll-behavior-y: 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-y: auto make the feed a scroll container.
  2. Reach the Y 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 — Chat Panel

Keep vertical scroll inside a chat messages box so the page behind stays still.

CSS
<style>
  .messages {
    height: 140px;
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }
</style>

<div class="chat">
  <h2>Chat</h2>
  <div class="messages">
    <p>Hello!</p>
    <p>How are you?</p>
    <p>Working on CSS.</p>
    <p>Nice — keep going.</p>
    <p>Done for today.</p>
  </div>
</div>
Try It Yourself

How It Works

  1. Scroll only the messages. The header stays fixed. The messages box gets overflow-y: auto.
  2. Contain vertical overscroll. overscroll-behavior-y: contain keeps edge scrolling inside the chat panel.
  3. Leave the page alone. Gestures at the top or bottom of the thread do not move the document behind.
  4. Physical axis. Top and bottom stay top and bottom even if writing mode changes later.

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 vertically, the property has nothing to control. Set overflow-y: auto on the same element.

logical

Y is physical, not logical

overscroll-behavior-y always means top and bottom. If you need an axis that follows writing mode, use overscroll-behavior-block instead.

chain

chain is newer

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

refresh

Pull-to-refresh needs none on the right box

To reduce page refresh on mobile overscroll, set none on the scrolling element that receives the gesture — often html or a full-page feed, not only a tiny inner panel.

shorthand

Do not confuse with the shorthand

overscroll-behavior sets both X and Y. This longhand only affects the vertical axis. Use overscroll-behavior-x for left and right.

Browser Support

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

✓ Limited availability · Safari 16+

overscroll-behavior-y

auto, contain, and none: Chrome 63+, Firefox 59+, Safari 16+, Edge 18+. chain: Chrome 150+, Firefox 157+, Edge 150+; not in Safari.

97% auto / contain / none
Google Chrome 63+ · chain in 150+
Full support
Mozilla Firefox 59+ · chain in 157+
Full support
Apple Safari 16+ · no chain
Partial
Microsoft Edge 18+ · chain in 150+
Full support
Opera 50+ · chain in 134+
Full support
Samsung Internet 8.2+
Full support
Internet Explorer Not supported
Not supported
overscroll-behavior-y 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 physical top and bottom edges of a scroll container.
  • Common pick: contain for modals and chat panels; none when bounce or pull-to-refresh must stop.
  • Physical axis: always vertical. Use overscroll-behavior-block for logical writing-mode behavior.
  • Initial value: auto. Not inherited. Needs a vertical scroll container.

One line: overscroll-behavior-y decides whether top/bottom overscroll chains out of a nested vertical scroll box.

Frequently Asked Questions

It controls what happens when scrolling reaches the physical top or bottom edge of a scroll container. It always targets the vertical axis, regardless of writing mode.
It is when scrolling past the top or bottom edge of one box continues scrolling a parent or the page behind it. contain and none stop that on the Y axis.
Use contain to stop vertical scroll chaining while still allowing local bounce. Use none when you also want to disable bounce and actions like pull-to-refresh.
overscroll-behavior-y always means top and bottom. overscroll-behavior-block follows writing mode, so it is vertical in English but horizontal in vertical writing modes.
No. Set it on the scroll container itself. The initial value is auto.
Chrome 63+, Firefox 59+, Safari 16+, and Edge 18+ 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: padding

Learn how padding creates space inside an element’s border.

padding 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