Setting the Margins of an Element

The margin is quite simply the amount of clear or transparent space between two elements not including any padding or border around the element.

To set the margin of an element:

Type margin: x
Here, x represents the amount of space which you wish to add and this can be expressed as a length, a percentage of the width, of the parent element, or auto.

When you simply use one value for margin, that value will be applied to all the four sides of your element equally.  When you use two values than the first is applied to the top and bottom and the second will apply to the right and left.  If you use three values, the first value will apply to the top, the second to right and left, and the third to the bottom.  Finally if you use four values, they will be applied to the top, right, bottom, and left in a strictly clockwise order.