HTML & CSS · Middle · Question 7 of 75

How do you define a "header on top, sidebar and content in the middle, footer at the bottom" layout in Grid with named areas?

Explanation

grid-template-areas describes the layout as string "pictures": "header header" "sidebar main" "footer footer", and items attach via grid-area: header. A dot . marks an empty cell. It's great for responsiveness: a media query only changes the template. There is no grid-area-names property.

Further reading

Problem with a question

HTML & CSS · Middle · question 7

Test yourself

Take the HTML & CSS · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz