Padding is the area that??™s sandwiched
between an element??™s borders and its
content. Any background image or background color that??™s applied to the element
will extend across the padding area. Refer to The CSS Box Model (p. 142) for an
in-depth discussion of how padding is accommodated within the CSS box model.
Example
This style rule assigns a two-pixel padding
value to the top side, a 4px padding value
to the right side, a 6px padding value to
the bottom side, and an 8px padding value
to the left side of paragraphs within the
element with ID "example":
#example p {
padding: 2px 4px 6px 8px;
}
When vertical padding (padding-top and padding-bottom) is used on an inline,
non-replaced element, it can cause the overlapping of elements above and below
that element in cases where the padding causes the element in question to exceed
the line height. See Inline Formatting (p. 166) for more information.
When horizontal padding (padding-left and padding-right) is used on inline,
non-replaced elements, it has a different effect than it has on block-level elements.
Pages:
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334