CSS overflow-inline Media Feature

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

Definition and Usage

The overflow-inline media feature tests how the output device handles content that overflows the initial containing block along the inline axis (the direction text runs in a line—usually horizontal in English).

It does not create overflow and is not the same as the overflow property. On most screens in browsers, the matched value is scroll.

Standard-track.

Baseline widely available since September 2023. Not deprecated, experimental, or non-standard.

Only two values.

Unlike overflow-block, overflow-inline supports only none and scroll—no paged / optional-paged.

CSS Syntax

syntax.css
@media (overflow-inline: none | scroll) { … }

Use it inside an @media rule to gate styles for scrollable vs non-scrollable inline overflow.

Feature Values

ValueDescriptionTry it
scrollInline overflow can be reached by scrolling (typical screens)Try it
noneInline overflow is not displayedTry it
scroll + wide textPractical pattern for single-line overflow stylingTry it
Both axesPair with overflow-block: scrollTry it

How to Use overflow-inline

Query the device capability first, then style wide content only when scrolling is available.

  1. Decide which axis matters—inline for horizontal text flow in LTR/RTL languages.
  2. Wrap styles in @media (overflow-inline: scroll) (or none).
  3. Add layout rules for wide tables, toolbars, or nowrap lines.
  4. Pair with overflow-block when both axes matter.
GoalTypical query
Screen with horizontal scroll(overflow-inline: scroll)
Device that clips inline overflow(overflow-inline: none)
Scrollable in both axes(overflow-inline: scroll) and (overflow-block: scroll)

Live Preview

This browser’s current match for overflow-inline (via matchMedia).

Detected value

Chips show which query matches here. You cannot force the device value from the page.

Result

Checking…

matchMedia pending

CSS Examples

Each snippet focuses on overflow-inline. Use Try It Yourself for a live editor.

Example 1 — Style When Inline Overflow Scrolls

Apply a cue only on devices that can scroll along the inline axis.

CSS
<style>
  @media (overflow-inline: scroll) {
    p {
      color: #b91c1c;
    }
  }
</style>

<p>Inline overflow can be scrolled on this device.</p>
Try It Yourself

How It Works

  1. Open a media query. @media (overflow-inline: scroll) asks the device about inline overflow.
  2. Match = scroll. Most browser viewports report this.
  3. Apply styles. Here the paragraph turns red only when the query matches.
  4. No match. If the device were none, these rules would not apply.

Example 2 — Cue for Single-Line Overflow

Keep a long line unwrapped, then highlight it when inline scrolling is available.

CSS
<style>
  p {
    white-space: nowrap;
  }

  @media (overflow-inline: scroll) {
    p {
      color: #b91c1c;
    }
  }
</style>

<p>This long single line may overflow the viewport horizontally.</p>
Try It Yourself

How It Works

  1. Force width. white-space: nowrap keeps the text on one line.
  2. Query capability. The media feature still only reports how overflow is handled.
  3. Style when scrollable. Color change signals that users can scroll to the rest.
  4. Element overflow. Clip/scroll on a box still uses the overflow / overflow-x properties.

Example 3 — Require Scroll on Both Axes

Combine with overflow-block for fully scrollable viewports.

CSS
<style>
  @media (overflow-inline: scroll) and (overflow-block: scroll) {
    p {
      color: #1d4ed8;
    }
  }
</style>

<p>Both axes support scrolling.</p>
Try It Yourself

How It Works

  1. Inline first. overflow-inline: scroll covers the text axis.
  2. Block second. overflow-block: scroll covers the stacking axis.
  3. AND them. Both must match for the rule to apply.
  4. Typical screens. Most browser windows match both as scroll.

Edge Cases & Pitfalls

If the query surprises you, one of these is usually why.

capability

It does not create overflow

The feature only reports how overflow is handled. Wide content still needs width, nowrap, or a small viewport to overflow.

property

Not the same as element overflow

Clipping a box uses overflow / overflow-x. The media feature is about the device/viewport capability.

values

No paged for inline

paged and optional-paged belong to overflow-block only. Do not use them with overflow-inline.

axis

Inline follows writing mode

In vertical writing-mode, the inline axis is vertical. Think in logical axes, not always “horizontal.”

print

Screens usually match scroll

Expect scroll in everyday browsers. none is uncommon for interactive screens; treat it as a progressive enhancement branch.

Browser Support

overflow-inline is a browser CSS media feature for viewport overflow capability. Node.js, Deno, and Bun do not evaluate it.

✓ Baseline · Widely available since Sep 2023

overflow-inline

Supported in Chrome 113+, Firefox 66+, Safari 17+, Edge 113+, Opera 99+, Samsung Internet 23+. Not supported in Internet Explorer.

94% Global support
Google Chrome 113+
Full support
Mozilla Firefox 66+
Full support
Apple Safari 17+
Full support
Microsoft Edge 113+
Full support
Opera 99+
Full support
Samsung Internet 23+
Full support
Internet Explorer No
Not supported
overflow-inline Widely supported

Bottom line: Safe for modern browsers. Keep a sensible default outside the query for older clients.

Key Takeaways

  • Role: media feature for how devices handle inline-axis overflow.
  • Values: only none and scroll.
  • Typical screens: match scroll.
  • Pitfall: it does not set element overflow—use the overflow property for that.

One line: use @media (overflow-inline: scroll) to tailor wide layouts when the device can scroll along the inline axis.

Frequently Asked Questions

It reports how the output device handles content that overflows the initial containing block along the inline axis (usually horizontal in English). It does not create overflow by itself.
Two keywords: none (inline overflow is not shown) and scroll (users can scroll to see inline overflow). Unlike overflow-block, there are no paged values.
The overflow property controls clipping or scrolling on one element. The overflow-inline media feature describes the device’s capability along the inline axis.
scroll. Typical browsers let you scroll when content is wider than the viewport.
overflow-inline is the inline axis (text direction). overflow-block is the block axis (usually vertical) and also supports optional-paged and paged.
Baseline widely available since September 2023: Chrome 113+, Firefox 66+, Safari 17+, Edge 113+. It is a browser CSS media feature, not a Node.js API.

Next: pointer

Detect fine vs coarse primary pointing devices.

pointer 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