Module 07 of 11

CSS Grid

Lessons

About This Module

Flexbox arranges items along one line. CSS Grid is built for the other half of the problem: laying out a page in rows and columns at the same time. It lets you define the structure of a layout in your CSS and then place content into it, which makes page-level layouts, dashboards, galleries, and card grids far simpler than they used to be.

This module starts with a beginner-friendly tour of Grid: defining columns, spanning cells, and placing items. It then introduces grid-template-areas, a visual way to name the regions of a layout and the fr unit for sharing space. From there you'll build responsive grids with repeat, minmax, and auto-fit that adapt to the screen without extra media queries, and finish with subgrid, which lets nested elements line up with the parent grid.

Watch the lessons in order, then continue on to Responsive Design.

Lessons

4 videos
01

Learn CSS Grid the Easy Way

A practical walkthrough of Grid: using the grid inspector, choosing how many columns you need, spanning columns, placing items, working with line numbers, and adapting with media queries.

02

The Easiest Way to Get Started with CSS Grid

Uses the grid-template-areas property to set the grid structure visually, then covers grid-template-rows, grid-template-columns, and how the fraction (fr) unit works.

03

Create Responsive CSS Grid Layouts with Grid Wrapping

Shows how repeat(), minmax(), fractions, and auto-fit combine to make grids that wrap and resize responsively.

04

Learn CSS Subgrid

Explains subgrid step by step: how it lets items of nested grids align to the parent grid, and how to use it.