overscroll-behavior-y

Controls what happens when you reach the end of a vertical scroll zone. This is the most common way to stop the background page from scrolling when a popup or menu is open.

It is documented as part of the CSS Overscroll Behavior specification.

/* Usage Example */
.sidebar-nav {
  /* Stops the main page from scrolling when the sidebar reaches the bottom */
  overscroll-behavior-y: contain;
}

/* Syntax */
overscroll-behavior-y: contain;
overscroll-behavior-y: none;
overscroll-behavior-y: auto;

/* Global values */
overscroll-behavior-y: inherit;
overscroll-behavior-y: initial;
overscroll-behavior-y: revert;
overscroll-behavior-y: revert-layer;
overscroll-behavior-y: unset;
Widely available Since 2022 95% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2022.

63+
59+
16+
18+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC