VibeDict

Padding vs Margin

Both are spacing. Padding is space inside the box (between the border and the content), and margin is space outside the box (between it and other boxes).

Padding

Space inside the box, between the border and the content.

Margin

Space outside the box, the distance to other boxes.

At a glance

PaddingMargin
WhereInside the borderOutside the border
Background colorGets colored tooStays uncolored
Think of it asBubble wrap inside a boxThe gap between boxes

Use “Padding” when…

  • When the text in a button looks cramped
  • When card content is pressed right up against the border
  • When you want a colored area to be bigger

🤖 Say it to your AI like this

Make the inner spacing (padding) of the buttons 12px top and bottom and 20px left and right. Keep the space between buttons the same.

More about Padding →

Use “Margin” when…

  • When sections are too close together
  • When you want space between cards
  • To add space between a heading and the text

🤖 Say it to your AI like this

Increase the outer spacing (margin) between sections to 80px top and bottom. Don't change the spacing inside the sections.

More about Margin →

💡 How not to mix them up

If you just say 'add more space', the AI may change either one. Say whether you mean inside (padding) or outside (margin).

More comparisons

← All comparisons