O'Reilly logo

CSS Pocket Reference, 4th Edition by Eric A. Meyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

overflow

Values:

[ visible | hidden | scroll | auto | no-display | no-content ]{1,2}

Initial value:

Not defined for shorthand properties (visible in CSS2.1)

Applies to:

Nonreplaced elements with a display value of block or inline-block

Inherited:

No

Computed value:

Same as declared value

Description:

A shorthand property that defines what happens to content that overflows the content area of an element. For the value scroll, user agents should provide a scrolling mechanism whether or not it is actually needed; for example, scrollbars would appear even if all content can fit within the element box. If two values are supplied, the first defines the value of overflow-x and the second defines overflow-y; otherwise a single value defines both.

Examples:

#masthead {overflow: hidden;}
object {overflow: visible scroll;}

Note:

In CSS2.1, overflow was a standalone property, not a shorthand property. As of mid-2011, no-display and no-content were not supported by any major browser.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required