1/* Apply to all four sides */
2margin: 1em;
3margin: -3px;
4
5/* vertical | horizontal */
6margin: 5% auto;
7
8/* top | horizontal | bottom */
9margin: 1em auto 2em;
10
11/* top | right | bottom | left */
12margin: 2px 1em 0 auto;
13
14/* Global values */
15margin: inherit;
16margin: initial;
17margin: unset;
1Margin is on the outside of block elements, padding is on the inside.
2
3Use margin to separate the block from things outside it
4Use padding to move the contents away from the edges of the block.
5
6Main differences:
7- Vertical margins of adjacent items will overlap, padding will not
8- Padding is included in the click region and background color/image,
9but not the margin