CSS overscroll-behavior-inline Property

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

What You’ll Learn

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.

01

Inline Axis

Horizontal in English.

02

Three Values

auto to none.

03

Default auto

Browser defaults.

04

Scroll Chaining

Stop parent scroll.

05

Carousels & Tables

Horizontal scroll UI.

06

Physical X Axis

Legacy shorthand.

Introduction

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

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

Basic Example

overscroll-behavior-inline.css
.scroll-container {

  width: 300px;

  overflow-x: auto;

  overscroll-behavior-inline: contain;

}

Syntax Rules

  • Accepted values: auto, contain, and none.
  • The element must be scrollable on the inline axis, usually with overflow-x: auto or overflow: auto.
  • overscroll-behavior is a shorthand for overscroll-behavior-block and overscroll-behavior-inline.
  • In horizontal writing mode, the inline axis maps to horizontal scrolling (left and right edges).
  • contain is the most common choice for carousels, tab strips, and wide table wrappers.

🎯 Default Value

The default value of the overscroll-behavior-inline property is auto.

With auto, scrolling past the left or right 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
Inline axis in horizontal writingHorizontal (left / right)
Common useCarousels, tab strips, image galleries, wide data tables, horizontal scroll panels

💎 Property Values

ValueExampleDescription
autooverscroll-behavior-inline: auto;The default value. The user can scroll past the boundary, and the browser may show an overscroll effect.
containoverscroll-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.
noneoverscroll-behavior-inline: none;Similar to contain, but also prevents any scrolling from propagating to parent elements.
auto — default contain — stop chaining none — no bounce

👀 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

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>



<div class="scroll-container">

  <div class="content">

    This is a horizontally scrollable container. Scroll to see the overscroll behavior in action.

  </div>

</div>
Try It Yourself

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.

overscroll-inline-auto.css
.panel {

  width: 300px;

  overflow-x: auto;

  overscroll-behavior-inline: auto;

  border: 1px solid #cbd5e1;

  border-radius: 0.5rem;

}
Try It Yourself

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.

overscroll-inline-none.css
.carousel {

  width: 320px;

  overflow-x: auto;

  overscroll-behavior-inline: none;

  border: 1px solid #334155;

  border-radius: 0.75rem;

}
Try It Yourself

How It Works

Neither the carousel strip nor the page responds to inline-axis overscroll actions at the container edges.

Example 4 — Wide Data Table Wrapper

Keep horizontal scroll inside a wide data table wrapper with overscroll-behavior-inline: contain so the page behind stays still.

table-scroll.css
.table-wrapper {

  max-width: 360px;

  overflow-x: auto;

  overscroll-behavior-inline: contain;

  border: 1px solid #cbd5e1;

  border-radius: 0.5rem;

}
Try It Yourself

How It Works

The table wrapper scrolls independently on the inline 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;

}



/* Inline axis only — horizontal in horizontal writing */

.carousel {

  overscroll-behavior-block: auto;

  overscroll-behavior-inline: contain;

}

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

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 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-inline property 95% supported

Bottom line: overscroll-behavior-inline is dependable for horizontal scroll UX in modern projects.

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.

💡 Best Practices

✅ Do

  • 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

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

Practice in the Live Editor

Open the HTML editor and experiment with overscroll-behavior-inline: contain, auto, and none on horizontally scrollable 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