A web page is content (the words and pictures), structure (HTML tags saying what each part is) and presentation (CSS saying how it looks). Swap the style sheet and only the look changes; show the structure and see the tags underneath.
One page, three completely different looks, and not a single word changed. What did change?
Every web page you read is built in three layers: content (what it says), structure (what each part is) and presentation (how it looks). You don't need to write code to see them: this board takes one page apart.
Predict: Read the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.
Try: Try it on the board and compare the result with your prediction.
Investigate: Work out why it happens, one step at a time.
Modify: Change the problem on purpose and see what happens.
Practise: A few on your own, to check you have it.
Make: Make your own problem using what you have learned. Expect a few tries; that is normal.
Make your prediction first. Help opens once you've locked it in.
PredictRead the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.
Style sheet off
TryTry it on the board and compare the result with your prediction.
Try: swap the look
Was your prediction right?
Try it yourselfYour edits are saved in this browser.
Try at least two style sheets and show the structure. Then switch the style sheet off. What is left?
Use the board. This ticks when you get there.
InvestigateWork out why it happens, one step at a time.
Worked example: one part, three layers
Worked exampleBefore each step, say what you think comes next.
content: This weekThe words on the page.
structure: <h2>This week</h2>The HTML tag says it is a level-2 heading.
presentation: h2 { color: teal; font-size: 20px; }The CSS rule says how every h2 looks.
change the style sheet⇒only presentation changesSame words, same tag, a new look.
Now sort the parts of the page.
Which layer is each one?
The words "Bring a friend!"
A photo of the robot
<h2> marking "This week" as a heading
<ul> and <li> marking the list
<nav> marking the menu
color: teal
font-size: 30px
The page's background colour
Sam compares the Plain and Poster styles. Click the line where it first goes wrong.
ModifyChange the problem on purpose and see what happens.
Vary: change one layer
Try it yourselfYour edits are saved in this browser.
In the style sheet, make the main heading (h1) a different colour. Did the structure or the words change?
Use the board. This ticks when you get there.
Now make every h2 heading at least 28 pixels tall, with one rule.
Use the board. This ticks when you get there.
This time edit the HTML: change the words "This week" to "Today". Which layer changed?
Use the board. This ticks when you get there.
PractiseA few on your own, to check you have it.
Which layer?
MakeMake your own problem using what you have learned. Expect a few tries; that is normal.
A new look
Then: open any website and imagine its style sheet switched off. What would its structure be?
Try it yourselfYour edits are saved in this browser.
Need a hint?
Only the style sheet box is yours to change.
Another hint
Try body { background: …; } and h1 { color: …; }.
Another hint
For example body { background: black; color: white; } and h1 { color: gold; }.
Give the page a completely new look: a new background and a new heading colour, without changing the HTML.
Use the board. This ticks when you get there.
For teachers
Students swap style sheets, show a page's structure and switch the style off to separate content, structure and presentation, then change one layer at a time (AC9TDI10K02 nodes 1 and 2), with no coding needed. About 40 minutes.
I can say which layer a part or a change belongs to.
I can change the look of a page without changing its structure or words.
Before class
Try the boards yourself.
The one idea: content, structure and presentation are separate layers. This is a Knowledge and understanding lesson: students read and tweak a style sheet but never have to write a page. The Code pathway's HTML & CSS course is where they build pages (its Rules and selectors lesson links back here).
Node 2's minimum width asks students to write a small page; here they edit an existing one, which covers the explanation part. Students who want to write their own can open the HTML & CSS course's first lesson.
Hands-on: in a browser, many sites can be seen without their style sheet (Firefox: View › Page Style › No Style; Safari's Reader view is similar).
Running the lesson
Predict: students who said a blank page think the style sheet holds the words.
Try: ask what stayed the same across all three looks.
Worked example: for each sorted item, ask "what it says, what it is, or how it looks?"
Vary: after the content change, ask which layer a translator would change.
Make: compare looks; ask whether anyone needed to touch the HTML.
The hard part (on purpose)
Students judge parts by how they look. Keep asking "what is it?" before "how does it look?", and use the Structure button to check.
When students get stuck
A student says the Poster style made new headings (Sam's mistake). Ask: Turn on Structure. Are the tags the same in every style? Fix: Yes: the style sheet changes looks only.
A student's CSS does nothing. Ask: Is the rule's selector a tag on the page (h1, h2, p, li)? Is there a semicolon and a closing brace? Fix: Fix the selector or the punctuation.
Stretch and support
Stretch: Find a website with a dark mode switch. Which layer does the switch change, and how could you tell?
Support: A three-column card: Content (what it says), Structure (what it is), Presentation (how it looks), with an example of each.
Where it leads
Next: Why keep them apart (sites, phones, screen readers).
Put to work in: Code › HTML & CSS (writing pages and style sheets).
What each step is for
style sheet off: Committing to what is left without the style sheet tests the new move: presentation is a separate layer from the content and structure.
Try: swap the look: Swapping style sheets and switching the style off settles the prediction: only the presentation changes.
Worked example: one part, three layers: Splitting one heading into its three layers models the new move. Sam thinks a style sheet changes what a part is, the misconception planted after the method.
Vary: change one layer: Each task changes one layer and checks the others stay put: a colour, a size, then the content itself (in the HTML), not the look.
which layer?: Naming the layer for everyday changes is the same move in mixed forms, plus a review of how text is stored.
a new look: Restyling the whole page without touching the HTML reverses the process: from a look you want to the presentation rules that make it.
Now you can
Name the three layers of a web page.
Say which layer a part or a change belongs to.
Change the look of a page without changing its structure or words.