HTML and CSS Reference
In-Depth Information
Name
padding
Values:
[ <length> | <percentage> ]{1,4}
Initial value:
Not defined for shorthand elements
Applies to:
All elements
Inherited:
No
Percentages:
Refer to the width of the containing block
Computed value:
See individual properties
Description:
A shorthand property that defines the width of the overall padding for an element or sets the
widths of each individual side's padding. Padding set on inline nonreplaced elements does not
affect line-height calculations; therefore, such an element with both padding and a background
may visibly extend into other lines and potentially overlap other content. The background of
the element will extend throughout the padding. Negative padding values are not permitted.
Examples:
img {padding: 10px;}
h1 {padding: 2ex 0.33em;}
pre {padding: 0.75em 0.5em 1em 0.5em;}
Search WWH ::




Custom Search