CSS overflow-block Media Feature

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

Definition and Usage

The overflow-block media feature tests how the output device handles content that overflows along the block axis (usually vertical in English layouts).

It does not mean overflow is happening. It reports the device’s handling style: scroll on typical screens, pages for print, and so on. Pair it with overflow-inline for the other axis.

Baseline · Widely available.

Not deprecated. Cross-browser since about September 2023 (Safari 17 completed Baseline).

Not the overflow property.

overflow styles one element. overflow-block here is a media feature about the device.

CSS Syntax

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

One keyword per query. Example: @media (overflow-block: scroll) { … }.

Feature Values

ValueDescriptionTry it
scrollOverflow can be reached by scrolling (typical screens)Try it
pagedOverflow continues on the next discrete page (print-like)Try it
noneBlock-axis overflow is not displayedTry it
optional-pagedScrollable, but manual page breaks can start a new pageTry it
With printCombine with the print media typeTry it
Both axesRequire scroll on block and inline overflowTry it

How to Use overflow-block

Enhance styles for scroll devices or paged output — keep a solid default first.

  1. Write base styles that work without the query.
  2. Add @media (overflow-block: scroll) for typical screens (extra spacing, sticky UI, …).
  3. Add @media (overflow-block: paged) or print rules for page-friendly layout.
  4. Check matches with DevTools or matchMedia (live preview below).

Live Preview

This page checks your browser with matchMedia for each keyword. On most screens only scroll matches.

Device checks

Print preview may match paged. Screens almost always match scroll.

Results
  • none: …
  • scroll: …
  • optional-paged: …
  • paged: …
Sample box uses real @media (overflow-block) rules.

Checking…

CSS Examples

On your machine, only matching queries apply. Screens usually light up the scroll example. Use Try It Yourself for a live editor.

Example 1 — scroll

Style content when the device can scroll block-axis overflow.

CSS
<style>
  .box {
    padding: 1rem;
    background: #e2e8f0;
  }

  @media (overflow-block: scroll) {
    .box { background: #dbeafe; }
  }
</style>

<div class="box">Blue on scroll devices.</div>
Try It Yourself

How It Works

  1. Set a base. Gray background works without the query.
  2. Query scroll. Matches typical browser viewports.
  3. Override inside the block. Soft blue applies when scroll matches.
  4. Most laptops/phones match. This is the everyday case.

Example 2 — paged

Target paged output (print and similar) where overflow continues on the next page.

CSS
<style>
  .box {
    padding: 1rem;
    background: #e2e8f0;
  }

  @media (overflow-block: paged) {
    .box { background: #fef3c7; }
  }
</style>

<div class="box">Amber on paged devices.</div>
Try It Yourself

How It Works

  1. Same base idea. Gray until a query matches.
  2. Query paged. Discrete pages instead of continuous scroll.
  3. Screen preview stays gray. Most screens do not match paged.
  4. Try print preview. Or pair with print for paper styles.

Example 3 — Both Axes Scroll

Require scroll handling on block and inline overflow together.

CSS
<style>
  .box {
    padding: 1rem;
    background: #e2e8f0;
  }

  @media (overflow-block: scroll) and (overflow-inline: scroll) {
    .box { background: #dcfce7; }
  }
</style>

<div class="box">Green when both axes can scroll.</div>
Try It Yourself

How It Works

  1. Combine with and. Both features must match.
  2. Block axis. overflow-block: scroll covers vertical overflow handling.
  3. Inline axis. overflow-inline: scroll covers the other direction.
  4. Typical screens match both. Good for “full scroll UI” enhancements.

Edge Cases & Pitfalls

This feature is about device capability — not whether your page currently overflows.

capability

It does not detect overflow

A short page on a scrollable screen still matches scroll. The query describes how overflow would be handled.

vs-property

Do not confuse with overflow

To clip or scroll one box, use overflow / overflow-y. This media feature will not set those behaviors.

screens

Screens usually match scroll

none, optional-paged, and paged demos often stay inactive in a normal browser tab.

print

Use print for paper layouts

For reliable print CSS, also use @media print. paged alone may not be enough in every UA.

axes

Block axis follows writing mode

In horizontal writing modes the block axis is vertical. Vertical writing modes flip which physical direction “block” means.

Browser Support

overflow-block is a browser CSS media feature for device overflow handling. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

overflow-block

Chrome 113+, Firefox 66+, Safari 17+, Edge 113+. Widely available since September 2023. Not supported in Internet Explorer.

94% Browser 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 Not supported
Not supported
overflow-block Widely supported

Bottom line: Safe for progressive enhancement on modern browsers. Keep defaults without the query. It is not a runtime API.

Key Takeaways

  • Role: how the device handles block-axis overflow (scroll vs pages).
  • Common match: scroll on screens; paged for print-like media.
  • Not overflow: it never sets scrolling on an element by itself.
  • Pair axes: use overflow-inline when both directions matter.

One line: use @media (overflow-block: …) to adapt styles for scroll vs paged block overflow.

Frequently Asked Questions

It reports how the output device handles content that overflows the initial containing block along the block axis — usually vertical in English layouts.
Four keywords: none, scroll, optional-paged, and paged.
Most browser screens match scroll — overflowing content can be reached by scrolling.
The overflow property controls one element’s clipping/scrolling. overflow-block as a media feature describes the device’s overflow handling; it does not set overflow on an element.
Paged typically matches print and similar paged media, where overflow continues on the next page.
It is Baseline and widely available since about September 2023 (Chrome 113+, Firefox 66+, Safari 17+). It is a browser CSS media feature, not a Node.js API.

Next: overflow-inline

Detect how the device handles overflow on the inline axis.

overflow-inline 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