Lab 03: CSS Grid Advanced
Overview
Step 1: Grid Template Areas
.dashboard {
display: grid;
grid-template-areas:
"header header header"
"sidebar main main "
"sidebar widgets widgets"
"footer footer footer";
grid-template-columns: 240px 1fr 300px;
grid-template-rows: 60px 1fr auto 50px;
min-height: 100vh;
gap: 0;
}
.dashboard__header { grid-area: header; }
.dashboard__sidebar { grid-area: sidebar; }
.dashboard__main { grid-area: main; }
.dashboard__widgets { grid-area: widgets; }
.dashboard__footer { grid-area: footer; }
/* Period (.) = empty cell */
.sparse-grid {
display: grid;
grid-template-areas:
"logo . nav"
". . . "
"hero hero hero";
}Step 2: Auto-Placement & Dense Packing
Step 3: minmax(), fit-content(), repeat()
Step 4: Named Lines
Step 5: Subgrid
Step 6: Implicit Grid
Step 7: Magazine Layout
Step 8: Capstone — HTML Generation with Grid Demo
Summary
Feature
Syntax
Use Case
Last updated
