Shortcut attribute that sets the widths of margins on four sides of an element. Margin extends beyond an elements width and height to reserve clear space between elements.
Setting one value gives all margins that value.
Two values and the top and bottom use the first, left a right use the second.
Three values, the first is used by the top second used by left and right and third by the bottom.
Four values are used from top clockwise around the element, top, right, bottom, left.
- Live Example
- Play with the code in the textarea below.
- one to four values or percentages
- Introduced in CSS version
- Applies to elements
- Browser Support
Browsers IE Firefox Safari Opera Chrome Versions 5 1 1 6 0.2
See the full list CSS properties and browser support: CSS Properties