All activities

A web page has three layers

Every web page you have opened is built from three layers, with HTML as the bones, CSS as the clothes and JavaScript as the movement. On this page you can switch each layer off and see what it was doing.

The three layers

Switch a layer off

This card has a switch for each layer. With CSS off the styling disappears, and with JavaScript off the button stops answering.

🦊

Hello, world


    

Three common layouts

Bento grid

One big block carries the main message, and smaller blocks fill the space around it.

Tier list

Rows run from best at the top to worst at the bottom, and the colour of each row shows the ranking before you read a word.

Social profile
🐢

The header says who the person is, and the grid underneath shows what they have made.

Three ways a page reacts

Hover without JavaScript
Point at me

CSS can react to the mouse on its own. JavaScript is worth adding only when CSS cannot do the job.

A counter
0

The page remembers a number and shows it again each time it changes. Most apps do a great deal of exactly this.

A theme switch
☀️

One class added to one element changes every rule tied to that class at once.

Asking an AI for a page

A vague request gets a vague page back. Tell the AI what the page is for, what goes on it and how it should feel.

Check yourself

Here are three questions about the layers, and every answer comes with an explanation.