style.overflow (Property)

The overflow style that defines how to display content that is too large to fix the element's stated box size.


CSS level - 2
DOM level - 2
JavaScript - 1.5
JScript - 3.0
Internet Explorer - 4.0
Netscape - 6.0
Property/method value type:String primitive
JavaScript syntax:-myStyle.overflow
CSS syntax:overflow: aType
Argument list:aTypeAn overflow type specifier

Sometimes you may add content to an element and cause the element to overflow its bounding extent rectangle. This property helps the browser determine what it should do with that overflowed content.

The following keywords may be applied to this property:

The general approach to handling overflow is to wrap the content within the width and increase the height to accommodate the flow. This may not be appropriate for some objects whose width formatting is fixed. This would be the case with a PRE object for example.

The visible setting allows the width to be expanded to accommodate the object in attempt to keep it all visible at once.

The hidden setting preserves the settings for the height and width. It may rearrange the content to better fill the extent rectangle, but it may clip the content within the extent rectangle so that the object retains the size it had already been defined to be presented with.

The scroll setting allows for scroll bars to be placed within the extent rectangle of the object itself if the content exceeds the present settings of the height and width extent rectangle. This behavior is not consistent across all platforms.

The auto setting displays scrollbars within the extent rectangle of the object if necessary, but appears to be functionally identical to the scroll value being defined. Again, this is not consistently supported across the platforms.

The workings of this property may be affected by the value defined for the position property. That is, this overflow technique is applicable to absolutely positioned elements.


See also:PRE object, style.position