Outside versus inside

Padding is space inside the border, between the content and the border. Margin is space outside the border, separating the element from others. You can also set individual sides, such as margin-top.

.card {
  padding: 1rem;      /* inside the border */
  margin: 0 0 1.5rem; /* outside the border */
}

Learn more