CSS overflow property
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.
overflow : overflow-x overflow-y
The content overflows out of the boundaries of the box and is also visibile.
It is the same as overflow: visibile visibile;
In this case, the content that overflows out of the box becomes invisible.
It is the same as overflow: hidden hidden;.
It provides scrollbar no matter whether the content overflows or not.
It is the same as overflow: scroll scroll;.
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;
It applies to block containers, grid containers, and flex containers.
Was this article helpful?