untitled

(John Hannent) #1

172 Part III: Adding Artistry: Design and Composition with CSS


Adding a margin .................................................................................

Finally, add a marginthat separates the paragraph element from a nearby ele-
ment; in this case, the next paragraph below, as shown in Figure 9-4:

<p style=”border-bottom: 12px blue dotted; padding-
bottom=.5in;margin-bottom=1in;”>

In each of the previous three figures, the box around the first paragraph has
grown in height, although its width did not change. Remember that the box
height is the combination of content, border, padding, and margin height.

Figure 9-4:
Add space
between the
first
paragraph
and the
following
paragraph
by adjusting
the
margin-
bottom
property.

Figure 9-3:
Here space
is padded
between the
paragraph’s
content and
border. A
border is
like a frame,
although a
CSS border
isn’t
required to
have four
sides.
Free download pdf