CSS overflow Property


Set the overflow property to scroll:

div {
    width: 150px;
    height: 150px;
    overflow: scroll;

Try it yourself »

Definition and Usage

The overflow property specifies what happens if content overflows an element's box.

Default value: visible
Inherited: no
Animatable: no. Read about animatable
Version: CSS2
JavaScript syntax: object.style.overflow="scroll" Try it

Browser Support

The numbers in the table specify the first browser version that fully supports the property.

overflow 1.0 4.0 1.0 1.0 7.0

CSS Syntax

overflow: visible|hidden|scroll|auto|initial|inherit;

Property Values

Value Description Play it
visible The overflow is not clipped. It renders outside the element's box. This is default Play it »
hidden The overflow is clipped, and the rest of the content will be invisible Play it »
scroll The overflow is clipped, but a scroll-bar is added to see the rest of the content Play it »
auto If overflow is clipped, a scroll-bar should be added to see the rest of the content Play it »
initial Sets this property to its default value. Read about initial Play it »
inherit Inherits this property from its parent element. Read about inherit

Related Pages

CSS tutorial: CSS Positioning

HTML DOM reference: overflow property




Search w3schools.com:

Translate w3schools.com: