CSS マージン(外側の余白)
◆ margin: top right bottom left (C1/e3/N4)

上下左右のマージン(余白)を 20px, 3em10% などのように指定します。margin: の引数は 1~4個指定が可能で、それぞれ、次のように解釈されます。上右下左の順番は、12時の方向から時計順と覚えましょう。

margin: 1px;             /* 上下左右=1px */
margin: 1px 2px;         /* 上下=1px、左右=2px */
margin: 1px 2px 3px;     /* 上=1px、左右=2px、下=3px */
margin: 1px 2px 3px 4px; /* 上=1px、右=2px、下=3px、左=4px */

マージンはボーダーの外側の余白、後述のパディングはボーダーの内側の余白になります。

他の要素
マージン
パディング
要素
↓ボーダー  パディング  ボーダー↓
マージン
他の要素
◆ margin-top: top (C1/e3/N4)
◆ margin-right: right (C1/e3/N4)
◆ margin-bottom: bottom (C1/e3/N4)
◆ margin-left: left (C1/e3/N4)

上下左右のマージンをそれぞれ個別に指定します。

margin-right: 2em;
margin-left: 2em;