Web Design

(Nancy Kaufman) #1

158


Work with Overflow ...............................................


2 In the declaration for the
element you want to set
overflow on, type
height:?;, replacing?
with the height of the
element. Be sure to include
a unit of measurement such
as px.

1 In your editor, open an
existing document that
contains content divided
into groups and an embedded
style sheet.

Note: The following steps can
also be done using an existing
external style sheet.


Work with Overflow


Y


ou can use the CSS height property to specify the height of an element, but if you do so and
then add more content than fits in the specified height, the browser may choose to either allow

the content to flow out of the container to the detriment of your layout, or it might crop or not


display the content. Unfortunately, different browsers handle this issue differently, so you cannot


be sure how your page will look. The CSS overflow property allows you to control this behavior by


adding a scrollbar as needed.


1


2

Free download pdf