Description & Usage

The overflow property specifies how a container element handles content that exceeds its width or height dimensions.

Common values like hidden clip overflowing content, while auto dynamically adds scrollbars when content exceeds bounds.

Property Specifications

Property FeatureSpecification
CategoryLayout
Initial Valuevisible
InheritedNo (not inherited)
Applies ToBlock containers, flex containers, grid containers

Syntax

overflow: visible | hidden | clip | scroll | auto;

Property Values

ValueDescription
visibleContent is not clipped and renders outside container box.
hiddenContent is clipped and no scrollbars are provided.
autoScrollbars are added automatically if content overflows.
scrollScrollbars are always visible regardless of overflow.

Code Examples

Scrollable Card Body
.modal-body { max-height: 400px; overflow-y: auto; }
Adds vertical scrollbar if content exceeds 400px height.