The CSS margin properties are used to create space around elements, outside of any defined borders.
With CSS, you have full control over the margins. There are properties for setting the margin for each side of an element (top, right, bottom, and left).
CSS has properties for specifying the margin for each side of an element:
margin-topmargin-rightmargin-bottommargin-leftAll the margin properties can have the following values:
To shorten the code, it is possible to specify all the margin properties in one property.
The margin property is a shorthand property for the individual margin properties.
If the margin property has four values:
If the margin property has three values: