CSS overscroll-behavior-x Property

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

Definition and Usage

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

Use it on carousels, tab strips, and wide tables so sideways overscroll does not move a parent scroll area. Pair it with overflow-x: auto. For both axes at once, use overscroll-behavior. For the logical inline axis, use overscroll-behavior-inline.

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

Property Values

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

Make a sideways scrollable box, then decide what happens when the user reaches its left or right edge.

  1. Give the element a fixed width and make it scroll with overflow-x: auto or overflow: auto.
  2. Put content wider than the box so a horizontal scrollbar appears.
  3. Set overscroll-behavior-x on that same scroll container. It is not inherited.
  4. Choose contain for most carousels and tab strips, or none when bounce must also stop.
PieceRequired?Role
Scroll containerYesNeeds overflow and content that can scroll horizontally
KeywordYesauto, contain, none, or chain
Parent scroll areaFor demosNeeded to feel scroll chaining when the value is auto

Live Preview

Scroll the white strip left or right to an edge, then keep scrolling. Change the value and compare how the outer dashed area reacts.

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

Nested horizontal scroll
One Two Three Four Five Six
Outer A Outer B Outer C

overscroll-behavior-x: contain

CSS Examples

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

Example 1 — Contain Horizontal Chaining

Stop a parent from scrolling sideways when a nested strip hits its left or right edge.

CSS
<style>
  .strip {
    width: 200px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    border: 1px solid #ccc;
    white-space: nowrap;
  }
</style>

<div class="strip">
  <span>One</span>
  <span>Two</span>
  <span>Three</span>
  <span>Four</span>
  <span>Five</span>
</div>
Try It Yourself

How It Works

  1. Make the box scroll sideways. width: 200px plus overflow-x: auto creates a horizontal scroll area.
  2. Fill past the width. white-space: nowrap keeps the items on one line that is wider than the box.
  3. Contain the overscroll. overscroll-behavior-x: contain stops 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 horizontal bounce or side-swipe navigation should not fire from a nested strip.

CSS
<style>
  .tabs {
    width: 220px;
    overflow-x: auto;
    overscroll-behavior-x: none;
    border: 1px solid #ccc;
    white-space: nowrap;
  }
</style>

<div class="tabs">
  <span>Home</span>
  <span>Docs</span>
  <span>Blog</span>
  <span>Shop</span>
  <span>Help</span>
</div>
Try It Yourself

How It Works

  1. Same scroll setup. A fixed width and overflow-x: auto make the tabs a horizontal scroll container.
  2. Reach the X edge. Scrolling past the first or last tab hits the left or right boundary.
  3. Turn off both effects. none stops chaining to parents and also blocks overscroll bounce.
  4. Mobile tip. This helps when a nested strip should not trigger browser back/forward swipe gestures.

Edge Cases & Pitfalls

If sideways overscroll still moves a parent, one of these is usually why.

overflow

It only applies to scroll containers

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

logical

X is physical, not logical

overscroll-behavior-x always means left and right. If you need an axis that follows writing mode, use overscroll-behavior-inline instead.

chain

chain is newer

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

swipe

Browser history swipe can still appear

On some mobile browsers, edge swipes navigate history. contain or none can reduce that from nested strips, but behavior still varies by platform.

shorthand

Do not confuse with the shorthand

overscroll-behavior sets both X and Y. This longhand only affects the horizontal axis. Use overscroll-behavior-y for top and bottom.

Browser Support

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

✓ Limited availability · Safari 16+

overscroll-behavior-x

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-x 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 left and right edges of a scroll container.
  • Common pick: contain for carousels and tabs; none when bounce must stop too.
  • Physical axis: always horizontal. Use overscroll-behavior-inline for logical writing-mode behavior.
  • Initial value: auto. Not inherited. Needs a horizontal scroll container.

One line: overscroll-behavior-x decides whether left/right overscroll chains out of a nested horizontal scroll box.

Frequently Asked Questions

It controls what happens when scrolling reaches the physical left or right edge of a scroll container. It always targets the horizontal axis, regardless of writing mode.
It is when scrolling past the left or right edge of one box continues scrolling a parent or the page behind it. contain and none stop that on the X axis.
Use contain to stop horizontal scroll chaining while still allowing local bounce. Use none when you also want to disable bounce and side-swipe navigation effects.
overscroll-behavior-x always means left and right. overscroll-behavior-inline follows writing mode, so it is horizontal in English but vertical 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: overscroll-behavior-y

Control overscroll on the physical vertical axis for top and bottom edges.

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