Project Step 3: Your Website Layout
- 5 min reading
- 7 min activity
0 of 5 tasks doneup to 105 XP
Project Step 3. Your website gets the layout of the course sketch, and it will read well on a phone and on a computer.
- Turn the sketch from the course slides into CSS for your own website.
- Keep the look of the sketch on a computer and let it stack on a phone.
- Use readable colours, link states and sections as cards.
In Project Step 2 you built five regions: header (banner), nav (main menu), main (content), aside (side menu) and footer (bottom menu). main and aside are inside <div class="columns">, ready for CSS.
From the sketch to CSS
The sketch in the slides is 900px wide, with boxes of fixed sizes: content 600px, side menu 300px. A phone screen is much narrower than 900px, so fixed boxes would stick out of it. We keep the look of the sketch on a computer, and on a phone the boxes stack.
From sketch to CSS
flex-wrap: wrap moves the side area below the content by itself.The plan
- The whole page
* { box-sizing: border-box; }, thenbodywithmax-width: 900px; margin: 0 auto;, a font list with a fallback,line-height: 1.6and readable colours (lessons 3.2, 3.3). - Banner and main menu
headerandnav ulbecome flex containers that can wrap. The menu list loses its dots and its padding (lessons 3.5, 3.7). - Content and side menu
.columns { display: flex; flex-wrap: wrap; gap: 16px; }withmain { flex: 2 1 300px; }andaside { flex: 1 1 200px; }: two shares to one, like 600 to 300 in the sketch (lesson 3.7). - Cards and links
Each section gets padding, a light border, round corners and a soft shadow. Links get a hover colour and a
:focus-visibleframe (lessons 3.3, 3.5, 3.6). - Pictures, form, table, footer
img { max-width: 100%; }keeps your picture on the screen; the table gets collapsed borders; the footer gets a thin line on top.
Write one part, press Run, look at the result on Phone and on Computer, then write the next part. You need no extra code for phones: the columns wrap by themselves.
Build it: your website layout
Guess first, then write your CSS. Your HTML from Step 2 is loaded. If you open the solution, copy only the CSS: the solution shows Ayla's page, and your own text should stay yours.
My website layout
Your page from Project Step 2 is loaded (if you have not saved one, you see the page of Ayla, a fictional learner). Write the CSS for your website in the CSS tab, one part after the other. The comments show the order.
Show your mentor or a friend your website on a phone and on a computer. Ask: is everything clear to read? Which part do you look at first?
Warm-up for the challenge
Three optional questions before the Unit 3 challenge. They are not part of the challenge.
Warm-up for the challenge (1 of 3)
Optional practice before the Unit 3 challenge. It is not part of the challenge.
Warm-up for the challenge (2 of 3)
Optional practice before the Unit 3 challenge.
Warm-up for the challenge (3 of 3)
Optional practice before the Unit 3 challenge.
- Layout
- Where the parts of a page sit.
- max-width
- The largest width. The page can still be narrower on a phone.
- Wrap
- Items move to a new line when there is not enough space.
- line-height
- The height of a line of text. 1.5 to 1.6 is comfortable to read.
In short
- The sketch's fixed 900px becomes
max-width: 900pxwithmargin: 0 auto. - Header, menu and columns are flex containers with
flex-wrap: wrap. flex: 2 1 300pxandflex: 1 1 200pxkeep the 2 : 1 look of the sketch on a computer and stack on a phone.- Readable colours, link states and cards make the website friendly for everyone.
The Unit 3 challenge: 10 questions on CSS. Pass it to finish Mission 3, "Make it yours".
Sources
- MDN Web Docs (2026). Basic concepts of flexbox and flex (grow, shrink, basis).
- MDN Web Docs (2026). flex-wrap.
- MDN Web Docs (2026). max-width and box-sizing.
- MDN Web Docs (2026). line-height (unitless values).
- W3C WAI (2026). Understanding Success Criterion 1.4.10: Reflow (content without sideways scrolling at 320 CSS pixels).
- W3C WAI (2026). Understanding Success Criterion 1.4.3: Contrast (Minimum).