CSS Layouts: Replacing the Table…

Margin

The Margin properties define the space around elements. It is possible to use negative values to overlap content. The top, right, bottom, and left margin can be changed independently using separate properties. A shorthand margin property can also be used to change all of the margins at once.

This is the margin property in action.

You can apply it to paragraphs too.

Padding

The Padding properties define the space between the element border and the element content. Negative values are not allowed. The top, right, bottom, and left padding can be changed independently using separate properties. A shorthand padding property is also created to control multiple sides at once.

This is the padding property in action.

It also applies to paragraphs.

Techrangers SM | November 1, 2004