CSS overflow property
Browser support · legacy reference
ChromePartial support
SafariPartial support
FirefoxPartial support
Internet ExplorerPartial support
EdgePartial support
OperaPartial support
Description
CSS overflow property represents the behavior of content when it overflows out of the box along both horizontal and vertical directions.
It is a shorthand property of overflow-x and overflow-y.
If only one value is specified, the other one is copied from the first one.
Syntax
overflow : overflow-x overflow-y
Property values
visibleDefault
-
The content overflows out of the boundaries of the box and is also visibile.
It is the same as overflow: visibile visibile;
- Try it
overflow: visible; hidden
-
In this case, the content that overflows out of the box becomes invisible.
It is the same as overflow: hidden hidden;.
- Try it
overflow: hidden; scroll
-
It provides scrollbar no matter whether the content overflows or not.
It is the same as overflow: scroll scroll;.
- Try it
overflow: scroll; auto
-
It is same as 'scroll' but its scrollbar is visibile only when the content overflows out of the box.
Both values are 'auto' i.e. overflow: auto auto;
- Try it
overflow: auto;
Applicable to
It applies to block containers, grid containers, and flex containers.