Spacings (Margin)


The margin properties are used to generate space around elements.

Margin is on the outside of block elements while padding is on the inside:

  • Use margin to separate the block from things outside it.
  • Use padding to move the contents away from the edges of the block.

Take a look at the following screenshot. Light blue area specifies 70px padding-top and light green specifies 70px margin-bottom.

Margin Properties

Margin TopvalueSets the left margin of an element.
Margin Rightvalue, autoSets the right margin of an element.
Margin BottomvalueSets the top margin of an element.
Margin Leftvalue, autoSets the bottom margin of an element.
Was this article helpful?

Couldn't Find Your Answer?

Get quality customer support with our professional support team.

Create A Support Ticket
Live Editor