Center the bottom row when using grid auto-fit

Kevin Powell on YouTubeWatch on YouTube

SaveMark complete

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

IntermediateUI27 min

About this video

A CSS tutorial showing how to center the leftover bottom row of a grid that uses auto-fit, instead of letting it start on the left. It walks through the approach and a Safari-compatible variant for front-end developers.

What you’ll learn

  • Center leftover items in a CSS grid using auto-fit
  • Adapt the technique for two- and three-column layouts
  • Apply a workaround for Safari when the bottom row is centered