It is possible to define these individual paddings simply by adding a direction suffix to the padding attribute. Padding-top will set the top padding for this element.

Value Description
size px - size in terms of pixels
em - size in terms of the current font size
in - size in terms of inches
cm - size in terms of centimeters
percentage The width of this element will be a percentage of the element it is inside of.


p { padding-top: 5px; border: 1px solid black; }


This paragraph had one padding speficied (top), using directional a declaration.

Compatibility Issues:

IE 5.0 - Padding can be buggy.
IE 5.5 - Padding can be buggy, but better than 5.0.