Skip to content

Day 3: Named Grid Areas

Design semantic page layouts visually using grid-template-areas.

1. Visual Layouts with grid-template-areas

Section titled “1. Visual Layouts with grid-template-areas”
.page-layout {
display: grid;
grid-template-areas:
"header header"
"sidebar main"
"footer footer";
grid-template-columns: 260px 1fr;
grid-template-rows: auto 1fr auto;
min-height: 100vh;
}
header { grid-area: header; }
aside { grid-area: sidebar; }
main { grid-area: main; }
footer { grid-area: footer; }
  1. Refactor a full page layout using grid-template-areas.
  2. Add a dot (.) in the area string to represent an empty space.