Name
padding-bottom, padding-left, padding-right, padding-top — NN 4 IE 4 CSS 1
Synopsis
Inherited: No
All four attributes set the padding width of a single side of an element. Padding is space that extends around the content box of an element up to but not including any border that may be specified for the element. Padding picks up the background image or color of its element. As you add padding to an element, you increase the size of the visible rectangle of the element without affecting the content block size.
CSS Syntax
padding-bottom:paddingThickness
padding-left:paddingThickness
padding-right:paddingThickness
padding-top:paddingThickness
JavaScript Equivalent
paddingBottom paddingLeft paddingRight paddingTop
Value
Values for paddingThickness
can be
lengths
or percentages of the next
outermost container size.
Initial Value
0
Example
BLOCKQUOTE {padding-left: 20; padding-top: 10} #narrowCol {padding-left: 30%; padding-right: 30%}
Applies To
All elements (CSS and NN); BODY
,
CAPTION
, DIV
,
IFRAME
, MARQUEE
,
TABLE
, TD
,
TEXTAREA
, TR
, and elements
(IE).
Object Model Reference
- IE
[window.]document.all.
elementID
.style.paddingBottom[window.]document.all.
elementID
.style.paddingLeft[window.]document.all.
elementID
.style.paddingRight[window.]document.all.
elementID
.style.paddingTop
Notes
Be aware that Navigator 4 adds its own three-pixel-wide transparent spacing around all four edges of an element. If the element has padding defined for it, the extra spacing is placed outside of the padding. ...
Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.