Use the overflow property to scroll overflowing content:
The overflow property sets or returns what to do with content that renders outside the element box.
Tip: If you want to hide the scrollbars of the entire document, use the overflow property on the body or the html element.
The overflow property is supported in all major browsers.
Return the overflow property:
Set the overflow property:
Value | Description |
---|---|
visible | Content is NOT clipped and may be shown outside the element box. This is default |
hidden | Content outside the element box is not shown |
scroll | Scroll bars are added, and content is clipped when necessary |
auto | Content is clipped and scroll bars are added when necessary |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Default Value: | visible |
---|---|
Return Value: | A String, representing the content that renders outside the element box |
CSS Version | CSS2 |
Use the overflow property to hide overflowing content:
Return the overflow property:
CSS tutorial: CSS Positioning
CSS reference: overflow property