HTML and CSS Reference
In-Depth Information
8.4.7.13. The overflow property
The
overflow
property tells the browser how to handle content that over-
flows the display area of an element. The default value of this property,
visible
, tells the browser to render all content, making it visible even if
it falls outside of the element's display area.
Erring on the side of caution, you most often want the browser to display
all of your document's contents. But in rare cases, elements may over-
lap, creating an ugly display. To prevent such mishaps, set the
overflow
property to either
hidden, scroll
, or
auto
.
The
hidden
value forces the browser to hide all content that overflows its
allotted space, making it invisible to the user. The value
scroll
creates
scroll bars for the element, which viewers may use to see the hidden
content. However, scroll bars are added to the element even if the con-
tent does not overflow.
Adding permanent scroll bars ensures that the scroll bars do not come
and go as the content of the element changes in size in a dynamic docu-
ment. The downside to this is the clutter and distractions that scroll bars
create. Avoid all this with the
auto
value for the
overflow
property. When
on
auto
, scroll bars appear only when they are needed. If the element's
content changes so that it is not clipped, the scroll bars are removed
from the element.
None of the currently popular browsers supports the
overflow
property.
8.4.7.14. The position properties
Without intervention, the browser flows document elements together,
positioned sequentially through the display. You can change this stand-
ard behavior with the CSS2
position
property, in conjunction with the
top, bottom, left
, and
right
properties.
If the
position
property is set to
static
, conventional HTML/XHTML lay-
out and positioning rules apply, with the left and top edges of the ele-