padding-bottom
padding-left
padding-right
padding-top
PROPERTY: padding
padding
:
length
|
percentage
Compatibility:
IE4+ N4+
Version:
Level 1
Inherited:
No
The
padding
property is a shortcut that allows you to set the values for
padding-bottom, padding-left, padding-right,
and
padding-top
in only one declaration.
You can declare one, two, three, or four values:
If you declare one value, the amount of padding between all four borders and the contents will be that value.
If you declare two values, the top and bottom padding will be set by the first value, the right and left padding by the second value.
If you declare three values, the top padding will be set by the first value, the right padding by the second, and the bottom and left padding by the third.
If you declare four values, the order is top, right, bottom, left.
length
The
length
value can be in any of the following seven units. Use the abbreviation.
Length
Abbrev.
centimeters
cm
ems
em
inches
in
millimeters
mm
picas
pc
pixels
px
points
pt
percentage
The
percentage
value is based upon the total width being defined as 100%.
Code:
body { padding: 25mm; }
body { padding: 1.0in; }
body { padding: 16pc 25pc; }
body { padding: 36pt 24pt 36pt; }
body { padding: 11.5%; }
body { padding: 10% 10% 10% 10%; }
or
<table border="2">
<tr>
<td style="padding: 22px 22px 22px 22px;">
22 pixels padding on all four sides
</td>
</tr>
</table>
Output:
22 pixels padding on all four sides
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information