Collapse the table of content
Expand the table of content


Sets a value indicating how to manage the content of the object when the content exceeds the height or width of the object.


{ overflow: sOverflow }

Possible values


String that specifies one of the following values:


Default. Content is not clipped and scroll bars are not added.


Content is clipped and scrolling is added only when necessary.


Content that exceeds the dimensions of the object is not shown.


Content is clipped and scroll bars are added, even if the content does not exceed the dimensions of the object.

The property has a default value of visible for all objects, with the exception of textarea which has a default value of auto. This property is not inherited.


The default value for the body element is auto.

Setting the overflow property to hidden on a textarea object hides its scroll bars.

Setting the overflow property to visible causes the content to be clipped to the size of the window or frame that contains the object.


The following example uses the overflow property to manage content of the object. This example uses an inline style to automatically adjust itself to overflowing content when the page is loaded:

<div id=odiv style="width: 200px; height: 200px; overflow: auto;">

In this example, the user can dynamically change the overflow property of a DIV object by choosing one of the possible overflow values from a select object:

function SetOverflow(o, svalue )
    o.style.overflow = svalue ;

<div id="div1" 
The quick brown fox jumps over the lazy dog.

<select onchange="SetOverflow(div1,
<option selected>visible

Standards information

This property is defined in Cascading Style Sheets (CSS), Level 2 (CSS2) Ee371234.xtlink_newWindow(en-us,Expression.40).png.

Applies to

a, abbr, acronym, address, applet, b, bdo, big, blockquote, body, center, cite, code, col, colgroup, custom, dd, defaults, del, dfn, div, dl, dt, em, embed, fieldset, font, form, html, hn, i, input type=button, input type=checkbox, input type=file, input type=image, input type=password, input type=radio, input type=reset, input type=submit, input type=text, ins, li, ol, p, q, rt, ruby, s, span, sub, tt, u, ul, var, xmp

See also



Send feedback about this topic to Microsoft. © 2011 Microsoft Corporation. All rights reserved.

Community Additions

© 2016 Microsoft