An introduction to CSS margin and padding, explaining what each does and how they differ, plus how auto margins can center an element. It is the first part of a miniseries aimed at new developers.
What you’ll learn
✓Explain the difference between margin and padding in CSS
✓Center an element on the page using auto margins
✓Recognise that auto margins need an assigned width