Web Design

(Nancy Kaufman) #1

123


CHAPTER

Formatting Your Pages 4


TIP


Can I also control the height of content?
Yes, but be aware that although an element’s width is determined by its parent element, an element’s
height is determined by its own content. Thus, setting the width to 100% expands the element horizontally
to fill its container, whereas setting its height to 100% does not expand it vertically. You also need to be
careful about setting too small a height, because browsers vary greatly on how they treat elements with
specified heights too small to fit the content.

● When viewed in a browser,
the elements have the
specified widths. This is most
apparent on the paragraphs.

3 Within the existing p
declaration, type width: ?;,
replacing? with the desired
width of the element.


3

Free download pdf