This tutorial will explain what margins and padding are, how they are different, and what they can be used for.

Margins

Margins are the spacing surrounding an element. Margins are not actually a part of the element, but they push other elements further away.

Padding

Padding is the spacing within an element. Padding will push the content inside the element further in.

Did this answer your question?