Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style overflow Property

Style overflow Property

Style Object Reference The Style object


Definition and Usage

The overflow property sets or returns how to handle content that is rendered outside an element's box.

Syntax

Set the overflow property:

Object.style.overflow="visible|hidden|scroll|auto|inherit"

Return the overflow property:

Object.style.overflow

Value Description
visible Default. Content is not clipped and is displayed outside the element's box.
hidden Content is clipped, content outside the element's box is not displayed, and the browser does not show a scrollbar.
scroll The browser shows a scrollbar, and content is clipped if necessary.
auto Content is clipped, and a scrollbar is shown if necessary.
inherit The value of the overflow property is inherited from the parent element.

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the overflow property.

**Note:** IE7 and earlier versions do not support the "inherit" value. IE8 supports "inherit" only if a !DOCTYPE is specified. IE9 supports "inherit".


Tips and Notes

**Tip:** If you want to hide the scrollbar for the whole document, use the overflow property on the body or html element.


Example

Example

Use the overflow property to hide overflowing content:

Runoob Tutorial(runoob.com)

This is some text. This is some text.

This is some text. This is some text.

This is some text. This is some text.

This is some text. This is some text.

This is some text. This is some text.

This is some text. This is some text.

This is some text. This is some text.


Try it »


Style Object Reference The Style object