Margin and Padding Deep Dive: The basics

Kevin Powell on YouTubeWatch on YouTube

SaveMark complete

Sign in to save videos and track what you’ve finished.

BeginnerUI13 min

About this video

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