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:
auto
hidden
scroll
visible
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.
Some versions of the MSIE browser on the Macintosh platform cannot cope with a scroll or auto attribute in this property. The scrollbars simply don't appear.
See also: | PRE object, style.position |
Prev | Home | Next |
style.outlineWidth | Up | style.overflowX |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |