Strategies for margins, padding, gaps, and more
Kevin Powell Media Inc.
CSS
February 3, 2025
Spacing on the web seems simple, but suddenly margins inexspicably collapse (or stop collapsing), padding is inconsistent in strange ways, and your layouts look off balance for reasons you don’t understand. In this video, Kevin explores how to take control of spacing through margins, padding, and gaps, and also explores the new box-trim properties and values.
🔗 Links
Second Example CodePen:
https://codepen.io/kevinpowell/pen/jENxeXV
First Example CodePen:
https://codepen.io/kevinpowell/pen/WNVaqeZ