CSS2 » Properties » padding-top

Version: Level 1

Compability: IE4+  N4+

Syntax:
padding-top : length | percentage
percentage
The percentage value is based upon the total height being defined as 100%.
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

The padding-top property allows you to insert padding (space) between the top border and the enclosed text or images. This property is not inherited.

Examples

Code:
body { padding-top: 25mm; }
body { padding-top: 1.0in; }
body { padding-top: 15pc; }
body { padding-top: 36pt; }
body { padding-top: 11.5%; }
Language(s): CSS2
Code:
<table border="2">
<tr>
<td style="padding-top: 22px;">
top padding
</td>
</tr>
</table>
Output:
top padding
Language(s): CSS2

See Also: