CSS Introduction | CSS Positioning Properties | overflow
The overflow property specifies whether to clip content or add scrollbars when an element’s content is too large to fit inside the specified area.
The overflow property works only for block elements with a specified height.
| Value | Description |
|---|---|
| visible | If content overflows, it is not clipped. The overflowing content is rendered outside the element’s box. This is the default value. |
| hidden | If content overflows, it is clipped. The remaining content is not visible. |
| scroll | If content overflows, it is clipped, but scrollbars are added so the remaining content can be viewed. |
| auto | If content overflows, scrollbars are added so the remaining content can be viewed. |
| initial | Sets this property to its default value. |
| inherit | Inherits this property from the parent element. |
overflow-x
The overflow-x property specifies how to handle the left and right edges of content when it overflows an element’s content area.
overflow-y
The overflow-y property specifies how to handle the top and bottom edges of content when it overflows an element’s content area.