← How a web page is made

How a web page is made: recap

For after the lessons: one card per lesson, to check what you remember. Answer each question in your head or on paper first, then check it. Nothing here is marked.

Three layers

1. Three layers

Try firstGive one example of each layer from a web page you use, and say which layer a dark mode changes.

Check your answer

For example: the article text (content), its headings and lists (structure), its colours and fonts (presentation). Dark mode changes presentation.

A web page is three layers:

  • Content: what it says (the words, pictures and links).
  • Structure: what each part is, marked with HTML tags (heading, paragraph, list, menu).
  • Presentation: how it looks, set by CSS rules in a style sheet (colours, fonts, sizes, layout).

Change the style sheet and only the look changes: the words and the structure stay the same.

The club page: its content (the words), its structure (header, headings, a list) and its presentation (the Ocean style sheet).
The club page: its content (the words), its structure (header, headings, a list) and its presentation (the Ocean style sheet).
Content, structure, presentation · Sound on for the voiceover
Open the lesson →

2. Why keep them apart

Try firstGive two reasons to keep a page's look in a style sheet instead of in its HTML.

Check your answer

For example: one change restyles a whole site; screen readers and phones use the structure, so the page works for more people and devices.

Keeping the layers apart means each one can change on its own:

  • A whole site: one style sheet styles every page, so one change restyles them all.
  • Phones: the same content and structure get different presentation on a small screen.
  • Screen readers: they read the structure aloud (headings, lists, menus), so a heading faked with big bold text is just plain text to a blind reader.

Structure says what each part is; presentation only says how it looks.

Page B: the same words as the club page, styled with big bold text instead of headings and a list.
Page B: the same words as the club page, styled with big bold text instead of headings and a list.
What a screen reader hears · Sound on for the voiceover
Open the lesson →