The overscroll-behavior-inline property controls what happens when a scrollable element reaches its inline-axis edge. In horizontal writing mode, that means left-right scrolling — essential for carousels, tab strips, wide tables, and horizontally scrollable panels.
The overscroll-behavior-inline property in CSS is used to control the behavior when a user scrolls to the edge of an element’s content in the inline axis (typically left-right in horizontal writing modes).
This property is useful for managing the behavior when users scroll past the bounds of a scrollable area, such as preventing overscroll effects like bouncing or panning.
Definition and Usage
In horizontal writing modes such as English, the inline axis runs left to right, so overscroll-behavior-inline controls horizontal overscroll behavior. Use it on elements that scroll horizontally inside a larger page, such as carousels, tab strips, image galleries, and wide data table wrappers.
Pair it with overflow-x: auto or overflow: auto so the element actually scrolls on the inline axis. Then set overscroll-behavior-inline: contain to keep horizontal edge scrolling inside that box.
The overscroll-behavior shorthand sets both block and inline axes at once. Use overscroll-behavior-block when you need to control vertical overscroll separately.
💡
Beginner Tip
Create a 300px-wide box with 600px-wide content and overflow-x: auto;. Scroll to the right edge and keep scrolling to feel horizontal scroll chaining, then add overscroll-behavior-inline: contain;.
Foundation
📝 Syntax
The syntax for the overscroll-behavior-inline property is as follows:
syntax.css
element{overscroll-behavior-inline:value;}
It can be applied to any scrollable element. Here, value can be one of the predefined keywords described below.
The default value. The user can scroll past the boundary, and the browser may show an overscroll effect.
contain
overscroll-behavior-inline: contain;
The scrolling behavior is contained within the element. No boundary scroll chaining occurs to parent elements, and the browser does not display an overscroll effect.
none
overscroll-behavior-inline: none;
Similar to contain, but also prevents any scrolling from propagating to parent elements.
auto — defaultcontain — stop chainingnone — no bounce
Preview
👀 Live Preview
Three scroll boxes with the same wide gradient content and different overscroll-behavior-inline values. Scroll each box to its left or right edge on the inline axis:
auto
contain
none
Hands-On
Examples Gallery
Contain horizontal scroll chaining with contain, compare default auto behavior, disable inline-axis bounce with none on a carousel strip, and isolate scroll inside a wide data table wrapper.
🔄 Inline-Axis Containment
Use overscroll-behavior-inline: contain when horizontally scrollable areas should not scroll the page behind them.
Example 1 — Horizontal Scroll Container with contain
In this example, we’ll use the overscroll-behavior-inline property to prevent overscroll effects when reaching the end of a horizontally scrollable container.
overscroll-inline-contain.html
<style>.scroll-container{width:300px;overflow-x:auto;border:1px solid #ccc;overscroll-behavior-inline:contain;}.content{width:600px;background-color:lightblue;}</style><divclass="scroll-container"><divclass="content">
This is a horizontally scrollable container. Scroll to see the overscroll behavior in action.
</div></div>
This is a horizontally scrollable container. Scroll to see the overscroll behavior in action.
How It Works
In this example, the overscroll-behavior-inline: contain; style prevents the parent page from scrolling when the user reaches the left or right edge of the scrollable area on the inline axis.
Example 2 — Default auto Behavior
With overscroll-behavior-inline: auto, the browser keeps its normal inline-axis overscroll behavior, including scroll chaining where supported.
Section one — scroll inside this panel first.Section two — keep reading until you reach the right 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 inline-axis scroll boundary, the browser may pass the horizontal scroll gesture to the page behind it.
🚫 Bounce & Horizontal UI
Disable inline-axis bounce with none on carousels or isolate horizontal scroll inside wide table layouts.
Example 3 — Horizontal Carousel Strip with none
Use overscroll-behavior-inline: none when you want to stop both horizontal scroll chaining and inline-axis overscroll bounce effects on a carousel or tab strip.
The table wrapper scrolls independently on the inline 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;}/* Inline axis only — horizontal in horizontal writing */.carousel{overscroll-behavior-block:auto;overscroll-behavior-inline:contain;}
A11y
♿ Accessibility
Do not trap users — Preventing inline-axis scroll chaining is helpful in carousels and tables, but ensure keyboard users can still navigate horizontally with arrow keys or focus management.
Keep scrollable regions discoverable — Pair overscroll control with visible scroll cues and sufficient contrast on horizontally scrollable content.
Prefer contain on data tables — so background page movement does not disorient screen reader users when scrolling wide tables.
Test touch devices — Inline-axis overscroll behavior is especially noticeable on horizontal swipe gestures in carousels and tab strips.
🧠 How overscroll-behavior-inline Works
1
User scrolls on the inline axis
A carousel, tab strip, or table wrapper scrolls horizontally in horizontal writing while content fits inside its bounds.
Scroll
2
Scroll reaches the left or right edge
The inner container can scroll no farther left or right on the inline axis.
Boundary
3
overscroll-behavior-inline is applied
The browser decides whether to chain horizontal scroll, bounce, or stop at the container edge.
Value
=
🔄
Controlled inline-axis overscroll
Horizontally scrollable panels stay isolated from the page behind them when you use contain or none on the inline axis.
Compatibility
Browser Compatibility
The overscroll-behavior-inline property is supported in most modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. It is important to test your implementation across different browsers 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-inline property95% supported
Bottom line:overscroll-behavior-inline is dependable for horizontal scroll UX in modern projects.
Wrap Up
Conclusion
The overscroll-behavior-inline property provides developers with a way to control the scrolling behavior at the edges of a container along the inline axis. This can be particularly useful for creating a seamless user experience by preventing unwanted overscroll effects or controlling the propagation of scrolling events.
Use this property to fine-tune the scrolling behavior on your web pages and ensure a smooth browsing experience for your users. Experiment with different values to see how they affect horizontal scrolling on your site.
Use overscroll-behavior-inline: contain on carousels, tab strips, and wide table wrappers
Pair with overflow-x: auto or overflow: auto
Test scroll edges on touch devices and trackpads with horizontal gestures
Use none when inline bounce effects feel distracting on carousel strips
Combine with the overscroll-behavior shorthand when both axes need the same value
❌ Don’t
Expect overscroll control without a horizontally scrollable container
Apply none everywhere when contain is enough
Confuse overscroll-behavior-inline with overflow-x
Forget keyboard navigation for horizontally scrollable regions
Skip cross-browser testing on Safari and mobile Chrome
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about overscroll-behavior-inline
Use these points when horizontally scrollable areas reach their edges.
5
Core concepts
🔄01
Inline Axis
Horizontal in English.
Purpose
⚙02
Default auto
Browser defaults.
Default
📝03
Three Values
auto to none.
Values
🚫04
contain Carousels
Stop horizontal chaining.
Use case
↔05
Shorthand Pair
Block + inline axes.
Companion
❓ Frequently Asked Questions
overscroll-behavior-inline controls what happens when a scrollable element reaches its inline-axis boundary, such as whether horizontal scroll chains to a parent or triggers bounce effects. In horizontal writing mode, the inline axis is horizontal (left and right).
The default value is auto, which means the browser uses its normal overscroll behavior on the inline axis, including scroll chaining where supported.
overscroll-behavior-inline targets the inline axis (horizontal in horizontal writing), while overscroll-behavior-block targets the block axis (vertical in horizontal writing). The overscroll-behavior shorthand sets both at once.
Use contain to stop horizontal scroll chaining while still allowing local bounce effects. Use none when you also want to disable inline-axis bounce and prevent scroll from propagating to parent elements.
Yes. Modern mobile browsers support overscroll-behavior-inline, which is especially useful for horizontal carousels, tab strips, and wide data tables where inline overscroll should not move the page behind.