What's the difference between paddings and margins?

Paddings are inside while margins are outside of any bordersPaddings are outside while margins are inside of any borders

The padding is inside the border, and the margin is outside the border.