The overflow property specifies what happens if content overflows an element’s box.
This property specifies whether to clip content or to add scrollbars when an element’s content is too big to fit in a specified area.
div { width: 150px; height: 150px; overflow: scroll; }
Value | Description | |
---|---|---|
visible | The overflow is not clipped. It renders outside the element’s box. This is default |
hidden | The overflow is clipped, and the rest of the content will be invisible | |
scroll | The overflow is clipped, but a scroll-bar is added to see the rest of the content | |
auto | If overflow is clipped, a scroll-bar should be added to see the rest of the content | |
initial | Sets this property to its default value. | |
inherit | Inherits this property from its parent element. |