Level 2 · Web Development Basics · Course 2.2 CSS and Responsive Design
Module 15: Page Layouts
Goal: understand the box model and arrange pages with Flexbox and Grid: menus in a row, cards side by side, and a header, content and footer that sit where they should.
You'll need: your styled site from Module 14.
Lessons
- 1The box model15–25 minutes✓
- 2Flexbox basics15–25 minutes✓
- 3Flexbox for real layouts15–25 minutes✓
- 4CSS Grid15–25 minutes✓
- 5Page layout and positioning15–25 minutes✓
🛠️Module practice: lay out your site
- Add
box-sizing: border-boxfor all elements. - Header with your name on the left and the menu on the right (Flexbox), sticky at the top.
- Content centred in a
.containerwith a maximum width. - A section of cards on the home page using Grid with
auto-fitandminmax. - Footer at the bottom of the screen on short pages.
- Check at different window widths, then commit.
✅Module check
Explain in a few sentences, in your own words:
What's the box model, and when would you use Flexbox and when Grid?
Show a good answer
A good answer mentions: every element is a box of content, padding, border and margin, and
box-sizing: border-box makes the width include padding and border. Flexbox arranges items in one direction
(a menu, a row of buttons, centring), with content deciding sizes; Grid arranges items in rows and columns at
once (galleries, page areas), with the layout deciding sizes. They're often combined.
📝Module quiz
10 questions · 10 marks each · 100 marks in all · pass mark 70% · retry as often as you like ·
