Label text with tags, and find out that the browser ignores line breaks in your code.
Under its colours and pictures, your school's website is plain text with tags around it.
Every web page is text with tags in it. A tag is a label: <h1> labels the main heading and <p> labels a paragraph. Most tags come in pairs, an opening tag <p> and a closing tag </p> with a slash, wrapped around the text they label.
Make your prediction first. Help opens once you've locked it in.
<h1>Sports day</h1>
<p>Sports day is on Friday.
Bring a hat
and water.</p>
<p>Races start at 9 am.</p>
Each <p> starts a paragraph and </p> ends it. How many lines of normal text do you think the page will show?
Compare the page with your prediction. Then put the cursor after Bring a hat and press Enter a few times: the page does not change. Now give Bring a hat and water. its own <p> and </p>, and watch it move to a new line.
| Code | What it does | Why |
|---|---|---|
<h1>Sports day</h1> |
Makes the main heading | <h1> opens it and </h1> closes it. The tag says what the text is; the browser picks the big, bold look |
<h2>When</h2> |
Makes a smaller heading for one section | <h1> to <h6> are all headings: the number is the level, and 1 is the biggest |
<p>Races start at 9 am.</p> |
Makes one paragraph | Each <p> starts a new paragraph, with a gap above it |
the three lines inside the first <p> |
Show as one line | The browser ignores line breaks in the code. Only a new <p> starts a new line |
<h1>Sports day</h1>
<p>Sports day is on Friday.
Bring a hat
and water.</p>
<p>Races start at 9 am.</p>
<h1>Sports day</h1>
<h2>When</h2>
<p>Sports day is on Friday.</p>
<h2>What to bring</h2>
<p>Bring a hat and water.</p>
What does each tag in this page do?
Tags, not lines of code, make paragraphs.
Sam pressed Enter and expected a new line.
Match each part of the page with its job.
Sam wants Bring a towel. and Races start at 9 am. on separate lines, but the page shows them on one line. Click the line that causes it.
Make this a notice for a different event on a different day.
Before a hint: what kind of stuck is this? Try a strategy first
Change only the words between the tags. Leave the tags as they are.
Split the long paragraph so the date and what to bring are separate.
Before a hint: what kind of stuck is this? Try a strategy first
End the first paragraph with </p> after Friday.
Then start the second with <p> before Bring.

Add an <h2> heading above each paragraph: When above the first, What to bring above the second.
Before a hint: what kind of stuck is this? Try a strategy first
A section heading uses <h2>, just like <h1> but smaller.
Put each <h2> on its own line, just above the paragraph it describes.

Split the one paragraph into two.
This ticks when your page has all of the above.
Add an <h2> heading above each paragraph.
This ticks when your page has all of the above.
Write a page about a place you know well (a park, a beach, a town you've visited): an <h1> title, two sections with <h2> headings, and a paragraph in each.
Before a hint: what kind of stuck is this? Try a strategy first
Start with the <h1> title, then add one section at a time: an <h2>, then its <p>.
Check the page after each tag you add. If the page looks wrong, look for a tag with a missing < or >, or a closing tag without its slash.

Write a page with a title, two headings and a paragraph under each.
This ticks when your page has all of the above.
Lesson done. You've finished every step you need.
Students label text with headings and paragraphs, and find out that the browser ignores line breaks in the code. About 40 minutes.
Open the teacher guide: answers, solutions, slides and a worksheet.
Read the unit primer "HTML structure in 5 minutes" first, then do the Make task yourself in the playground (about 5 minutes).
The surprise for students: pressing Enter in the code does not make a new line on the page. Only a new <p> does. A tag is a label in angle brackets, like <p>. Most tags come in pairs: an opening tag <p> and a closing tag </p> with a slash, wrapped around the text they label.
Seeing that line breaks in the code do nothing. Let the Predict surprise land, and ask which tag starts a new line rather than fixing it.
Stretch: Add a third section with an <h2> heading, and try <h3> and <h4> to see what the heading numbers do.
Support: Give students the Modify starter and ask them only to change the words between the tags, then add one <h2>. Point to the Reference drawer for each tag.
Next lesson puts tags inside other tags, so a word can be important inside a paragraph, and finds out what the browser does when a tag is missing. Class idea: show a news website and ask students to spot the headings and paragraphs.