Try firstA student presses Enter in the middle of a paragraph in their code, but the page does not change. Why, and how do they start a new line?
Check your answer
The browser ignores line breaks in the code. To start a new paragraph, end the first with </p> and start the next with <p>.
The video and the picture show the same steps:
A tag is a label. <h1> labels the main heading.
<p> opens a paragraph and </p> closes it.
Two lines of text in the code show as one line on the page: the browser ignores line breaks in the code.
A new paragraph needs its own <p>.
In the picture, Boxes is on: each box is a tag, and the paragraphs are separate boxes.
What this code makes (with Boxes on: each box is a tag)Tags label text, and line breaks in the code do not show · Sound on for the voiceoverVoice: Open the lesson →
Try firstA student writes <strong>Friday <em>night</strong></em>. What is wrong, and what will the browser say?
Check your answer
The tags cross: <em> was opened last so </em> must come first. The browser says nothing; it makes a best guess and the page may look wrong.
The video and the picture show the same steps:
<strong> marks important words and the browser makes them bold.
<em> goes inside it and marks a stressed word, slanted.
The tag opened last closes first: </em>, then </strong>, then </p>.
If a tag is missing or crosses, the browser shows no error. It makes its best guess.
In the picture, Boxes is on: <em> is a box inside the <strong> box, inside the <p> box. A comment, <!-- a note -->, is ignored by the browser.
What this code makes (with Boxes on: each box is a tag)A tag can go inside another tag, and the last one opened closes first · Sound on for the voiceoverVoice: Open the lesson →
Try firstA rule h2 { color: purple; } is added to a page with four h2 headings. How many turn purple, and is any <h2> changed into something else?
Check your answer
All four turn purple, because the selector names the tag. None changes into something else: the tag is still h2, and the rule only changes how it looks.
The video and the picture show the same steps:
CSS rules go in a <style> block, at the top of the code for now.
A rule starts with a selector: p picks every paragraph, and nothing else.
Inside the braces: a property, a colon, a value, a semicolon, as in color: teal;.
Both paragraphs turn teal. The heading is not a p, so it stays as it was.
A second rule can style the heading. The HTML never changed.
Rules change how parts look. The tags still say what each part is.
What this code makesA rule names a tag, then sets how every one of them looks · Sound on for the voiceoverVoice: Open the lesson →
Try firstA student types 1. 2. 3. at the start of each item in an <ol>. What does the page show, and what should they do?
Check your answer
Each item shows two numbers, the one the browser added and the one typed. They should delete the typed numbers: the <ol> counts for them.
The video and the picture show the same steps:
<ul> opens a box for a list.
Each <li> is one item, inside the list.
</ul> closes the list.
<ol> makes a numbered list. The browser does the counting, so you never type the numbers.
An item is a box too, so a whole list can go inside an <li>.
Every <li> must be inside a <ul> or an <ol>. In the picture, Boxes is on: you can see each item inside its list.
What this code makes (with Boxes on: each box is a tag)A list is a box of items, and an item can hold another list · Sound on for the voiceoverVoice: Open the lesson →
Try firstIn <a href="https://example.com/rules">club rules</a>, which part do people see on the page, and which part says where the link goes?
Check your answer
They see club rules. The href attribute, inside the opening tag, says where it goes.
The video and the picture show the same steps:
<a> makes a link, and the words between <a> and </a> are what people click.
href is an attribute. It goes inside the opening tag as href="address".
Only the words show on the page. The address stays hidden inside the tag.
In the picture, Boxes is on: the link is one box, with its words inside.
What this code makes (with Boxes on: each box is a tag)A link keeps its address inside the opening tag · Sound on for the voiceoverVoice: Open the lesson →
Try firstA menu link has href="results" and a heading has id="results". The link does not jump. What is missing, and why?
Check your answer
The #. href="#results" means the element named results on this page; without it the browser looks for another page called results.
The video and the picture show the same steps:
An id gives one element a name. Here the heading is named results.
A link whose href starts with # jumps to the element with that name.
The # is the difference. Without it, the browser looks for another page.
Each name belongs to one element, so no two elements share an id.
What this code makes (with Boxes on: each box is a tag)An id names a place, and a # link jumps to it · Sound on for the voiceoverVoice: Open the lesson →
Try firstA sign-up form has a label Email and a box, but clicking Email does nothing. Give the likely cause and the fix.
Check your answer
The label's for does not match the box's id (or is missing). Make them the same, for example for="email" and id="email".
The video and the picture show the same steps:
A <form> holds the boxes people type in.
A <p> puts a label and its box on their own line.
The label's for matches the box's id, so clicking the label finds the box.
A <button> is for sending the answers...
...but nothing is connected to it. Code behind a form does the work.
A <select> with <option> items makes a drop-down list.
What this code makes (with Boxes on: each box is a tag)A label links to its box by id, and a form does nothing alone · Sound on for the voiceoverVoice: Open the lesson →
Try firstName three parts of your page and the tag, attribute or rule behind each.
Check your answer
For example: the menu is a nav list of links, and each href matches a section's id; the gold winners are rows with class winner and a .winner rule; the sign-up labels work because each for matches a box's id.
The picture shows the finished page. Build it in this order, one milestone at a time:
Header and menu: a <header> with a <nav> list of links to #ids, coloured by tag rules.
Sections: a list, a picture and a results table, with the winners marked by a class.
Sign-up and footer: a <form> with labels linked to their boxes, and a <footer>.