HTML and CSS lesson 2: The parts of every web page
US version. US grades and US spelling. · UK version of this lesson
Every page has the same skeleton: <!DOCTYPE html>, then <html> holding a <head> (facts about the page) and a <body> (what you see). A complete 40-minute HTML and CSS lesson for beginners (Grades 6–7), from Unit 1: Web pages and HTML. You build real web pages right here in your browser – nothing to install.
- Time
- 40 minutes + 20 min homework
- Grade
- Grades 6–7 (ages 11–12)
- You need
- A computer or tablet, paper and a pencil
- Graded
- Instantly, with explanations
For parents: how to use this lesson
You don't need to know HTML yourself. The lesson explains each step on screen, the way Mr Babbage, our Head of Computing, likes it: a worked example first, then a go for your child. When your child builds a page, the browser draws it straight away and Classfern grades it with a checklist.
- Read what your child will learn together.
- Press Start the lesson below. Sit with your child for the teaching and the worked example (about 15 minutes): ask them to point at each tag and say what it does.
- Let them do the practice on their own. If a page doesn't look right, the checklist says what is missing – let them find the mistake before you help.
- Finish with the exit questions and the talk question: “What would a screen reader do with a page that doesn't say its language?”
- Later that day or the next day: the homework (20 minutes), then a practice test.
Watch out for
- The
<title>is the big heading on the page. The title is on the tab; the heading on the page is<h1>. - The order of
<head>and<body>doesn't matter.<head>always comes first, then<body>.
Miss Lovelace's tip for home: ask your child to change one thing on their page – a word, a color, a size – and predict what will happen before they look. Predicting first is how programmers learn fastest.
What your child will learn
Learning goal: write the skeleton of a web page from memory.
Success looks like
- I can write the skeleton of a web page from memory.
- I can say what goes in the
<head>and what goes in the<body>. - I can give a page a title and a language.
Key words
DOCTYPE · head · body · title · lang attribute · nesting · comment
What to have ready
- A device with a web browser (pages are built and checked right in the browser – nothing to install)
- Paper for planning and sketching
- A keyboard helps for typing code (a tablet works too)
The big ideas (for the adult)
Line one of every page is <!DOCTYPE html>. It tells the browser "this is a modern web page". Then everything goes inside <html lang="en"> – the lang tells screen readers and translation tools what language the page is in.
The <head> holds facts ABOUT the page that are not drawn on it, such as the <title> (the words on the browser tab, and in search results). The <body> holds everything you see.
Elements sit inside each other like boxes in boxes. A neat page indents or lines up its tags so you can see which box each one is in – and closes them in the reverse order to opening them. Comments, written <!-- like this -->, are notes for people reading the code; the browser ignores them.
Worked example: a whole page
<h1>My first page</h1> <p>The tab says "My first page" too.</p>
The lesson, step by step
| Part | Time | How it is checked |
|---|---|---|
| Starter | 5 min | Graded by Classfern |
| Learn | 8 min | Read, watch and talk |
| See it | 7 min | Graded by Classfern |
| Practice | 15 min | Graded by Classfern |
| Check and reflect | 5 min | Graded by Classfern + self-check |
The lesson
It runs here on the page. No sign-up and no names – nothing you type is sent anywhere. Each visit picks a new mix of questions.
Homework
20 minutes: predict what the browser will do, build or fix a short page, and check the key ideas – then a short reflection. New questions every time, all graded instantly.
Practice tests
- HTML basics test12 questions · graded instantly
- Mixed HTML and CSS test20 questions · graded instantly
- Mixed HTML and CSS test20 questions · graded instantly
All computer science practice tests · All 20 HTML and CSS lessons
Curriculum
CSTA K–12 Computer Science Standards (2017), grades 6–8: 2-AP-19 – Document programs so they are easier to follow, test and debug.
The standard codes are CSTA's; the descriptions are our own words.
Our lessons and questions are our own. They are not written or endorsed by any government department, testing agency or exam board. HTML and CSS are open web standards; Classfern is not affiliated with the organisations that publish them.