Web Design

(Nancy Kaufman) #1

118


Apply Spacing with Padding ...................................


2 Within an existing h1
declaration, type padding-
left: ?;, replacing? with
the amount of padding you
want to apply.
3 Press.

1 In your editor, open a
document that contains
an embedded style sheet.

Apply Spacing with Padding


T


he space around elements on your page is defined by something known as the box model. The
innermost section of the model is the element’s content. The content is surrounded on all four

sides by padding, which in turn is surrounded by a border. Outside the border is a margin. The


padding property allows you to control the space between the content and the border; in essence,


it allows you to move the element within the box. You can easily remember this by thinking of a


physical package: You add padding between the fragile contents and the edge of the package.


1


2

Free download pdf