CSS overflow-y Property
Description
The overflow-y property controls how content that overflows a box along the vertical axis is handled by the formatting/painting system. It determines whether the box clips the overflowed content, creates a vertical scrolling mechanism, or delegates the overflow behavior to other layout rules. Because it applies specifically to the vertical direction, it is often used when you want independent control of vertical behavior while leaving horizontal handling to another property such as overflow-x or the shorthand overflow.
In terms of layout, setting overflow-y can cause an element to become a scroll container for its descendants; that affects how descendants participate in scrolling and which ancestor serves as their scroll-snap or containing block for various layout effects. Its interaction with fixed-size constraints is common: a scroll container usually appears when an element has a constrained size (for example via height or width), and the overflow behavior will determine whether excess content is clipped or made scrollable. Because the element becomes the source of vertical scroll, user input (keyboard, wheel, touch) and focus navigation will target that container rather than an outer one.
Practical considerations include nested scroll chains and how multiple scrollable ancestors interact on touch devices or when programmatically scrolling; thoughtful use of overflow-y helps avoid surprising nested scroll behavior. It also interacts with how elements are rendered and composited: creating scrollable regions can change painting boundaries and hardware-accelerated layers, which has implications for performance in complex UIs. Finally, when using overflow-y, remember how it pairs with layout contexts set by other properties - display modes (for example controlled by display) and positioning rules (see position) can affect both the appearance and the scrolling behavior of the element - so consider those interactions when designing scrollable components.
Definition
- Initial value
- visible
- Applies to
- Block containers, flex containers and grid containers
- Inherited
- No
- Computed value
- As specified
- Animatable
- No
- JavaScript syntax
- object.style.overflowY
Interactive Demo
Syntax
overflow-y: visible | hidden | scroll | auto
Values
- visibleContent is not clipped and scroll bars are not added. Elements are clipped to the size of the containing window or frame.
- hiddenContent that exceeds the dimensions of the object is not shown.
- scrollContent is clipped and scroll bars are added, even if the content does not exceed the dimensions of the object.
- autoContent is clipped and scrolling is added only when necessary.
Example
Browser Support
The following information will show you the current browser support for the CSS overflow-y property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
