CSS overflow property
Set the overflow property to scroll:
{
width:150px;
height:150px;
overflow:scroll;
}
Try it out . . .
Description of property definition and use
The overflow property specifies what happens if the content overflows a box of an element.
Default: | visible |
---|---|
Inherited: | no |
Version: | CSS2 |
JavaScript syntax: | object .style.overflow="scroll" |
Browser support
The numbers in the table support the first browser version number of the property.
Attributes | |||||
---|---|---|---|---|---|
overflow | 1.0 | 4.0 | 1.0 | 1.0 | 7.0 |
Note: At X Lion (Mac OS), the scroll bar display is hidden by default only if used (even if "overflow:scroll" is set).
The property value
Value | Describe |
---|---|
visible | The default. The content is not trimmed and rendered outside the element box. |
hidden | The content is trimmed and the rest is not visible. |
scroll | The content is trimmed, but the browser displays a scroll bar to see the rest. |
auto | If the content is trimmed, the browser displays a scroll bar to see the rest. |
inherit | Specifies that the value of the overflow property should be inherited from the parent element. |
Related articles
CSS tutorial: CSS Positioning