HTML and CSS Reference
In-Depth Information
Note
• Elements may have default padding on them, and these values may vary by user
agent. Because of this inconsistency, many developers prefer to clear all padding
values globally with a wildcard rule like
* {padding: 0;}
and build up
individual values.
padding-bottom
This property sets the distance between an element's bottom border and the bottom of its
contained content.
Syntax
padding-bottom:
length
|
percentage
| auto | inherit
where the
length
is measured in any fixed measurement, such as inches (
in
) or pixels. A
percentage
value is determined as a percentage of the height of the containing block. The
default value for the property is
0
.
Examples
p {padding-bottom: 10pt;}
.tight {padding-bottom: 0;}
#ex2 {padding-bottom: 10%;}
Compatibility
CSS 1, 2, 3 IE 4+ (buggy), 5+ Netscape 4+ (buggy), 6+, Firefox 1+ Opera 4+, Safari 1+
Note
• Elements may have default paddings on them, and these values may vary by user
agent. Because of this inconsistency, many developers prefer to clear all padding
values globally with a wildcard rule like
* {padding: 0;}
and build up
individual values.
padding-left
This property sets the distance between an element's left border and the left edge of its
content.
Syntax
padding-left:
length
|
percentage
| auto | inherit
where the
length
is measured in any fixed measurement, such as inches (
in
) or pixels (
px
). A
percentage
value is determined as a percentage of the width of the containing block. The
default value for the property is
0
.
Example
p {padding-left: 20px;}
.tight {padding-left: 0;}
#ex8 {padding-left: 40%;}