Margin |
margin: 10px 5px 15px 20px; |
margin: 10px 5px 15px; |
margin: 10px 5px; |
margin: 10px; |
- If there are four elements, the spacing goes clockwise from the top margin (top, right, bottom, left).
- If there are three elements, the first input is the top margin, followed by both the right and left margins, and then the bottom margin.
- If there are two elements, the top and bottom margins are the first input, and the left and right margins are the second input.
- If there is only one element, then all four margins share the input.
- Margin by itself is the shorthand version, you can adjust the individual ones by using margin-top, margin-right, margin-bottom, and margin-left.
|