Grade 9 Computer Science · The web — a page’s three languages
Three languages, three jobs
Why a page is not written in one language, and what each of the three does.
A page without a single color, and it still works
You can write a page without any color, spacing or animation, and it will still work — and a search engine will understand it exactly as it understands the styled version. So why is a page written in three languages and not one? It turns out each language answers an entirely different question.
A web page is written in three different languages working together. That sounds like a historical complication, and it is in fact a deliberate separation — the same separation of roles seen in breaking into functions and files, only that here it is enforced by the tools themselves.
| The question | The job |
|---|---|
| What is here | Structure and meaning |
| How does it look | Appearance |
| What happens when touched | Behaviour |
<!-- structure -->
<button id="more">Show more</button>
/* appearance */
#more { padding: 8px 16px; border-radius: 6px; }
// behaviour
document.querySelector("#more").addEventListener("click", reveal)Why it was built this way
The separation gives exactly what we saw a separation of roles always gives: one can be changed without touching the others. Redesigning a whole site changes the appearance layer and touches nothing in the structure; adding behaviour requires changing nothing in what is written on the page. And there is a second advantage here with no counterpart in ordinary code: the same structure is read also by whoever does not see the appearance at all — a search engine, a screen reader, or an old browser. The bottom layer is what remains when everything else falls away.
Example 1 — changing appearance without touching structure
- The site’s design changes entirely.
- The appearance layer is rewritten.
- The structure stays exactly as it was.
- And the behaviour keeps working too.
Example 2 — whoever reads only the structure
- A screen reader does not see colours.
- It reads the structure alone.
- If the structure is right, the page is usable.
- And if not — the appearance will not help.