CODE BUILDERS Lesson 2 of 6 ← All courses
Station 2 · Brick Yard

HTML Building Blocks

Every web page is built from small blocks called tags. Today you'll learn the most useful ones, and add headings, lists and a picture to your site.

About 40 minutes. You can stop and come back. Your answers are saved in this browser.

Part 1 · Warm-up

What do you remember?

Last time you made your first page. Let's see what you remember!

Part 2 · Learn it

Tags are building blocks

HTML is made of tags. A tag tells the browser what each piece of the page is: "this is a heading", "this is a list", "this is a picture". Most tags come in pairs: an opening tag and a closing tag with a slash. Whatever sits between them is the content.

<p>I love skateboarding.</p>

The blocks you'll use most

TagWhat it makes
<h1> to <h3>Headings. h1 is the biggest. Use one h1 per page, then h2 for sections.
<p>A paragraph of text.
<ul> + <li>A bullet list. ul holds the list, and each li is one item.
<ol>A numbered list (with li items too).
<strong>Bold, important words.
<img>A picture. It has no closing tag!
<section>A box that groups one part of the page together.

Watch the blocks work

EXAMPLE 1A section, block by block
<h1>Skate Zone</h1>
<h2>My favorite tricks</h2>
<p>These are the tricks I'm learning right now.</p>
<ul>
  <li>Ollie</li>
  <li>Kickflip</li>
  <li>Manual</li>
</ul>
<p>The <strong>ollie</strong> is where every trick starts.</p>

Notice the list: the ul wraps around all the li items, like a box holding three cards.

EXAMPLE 2Adding a picture
<img src="my-board.png" alt="My skateboard with green wheels and a lightning bolt sticker">

src is the picture's filename. The picture file must be saved in the same folder as your page, with exactly the same name.

alt is a short description of the picture. Screen readers read it out for people who can't see the picture, and the browser shows it if the picture can't load. Describe what's actually in it!

  • πŸ“ my-website
    • πŸ“„ index.html
    • πŸ–ΌοΈ my-board.png ← same folder!
Byte says

Picture rules for your site: use your own drawings or photos of things, not people. Don't copy pictures from other websites, because they belong to someone else. And keep the filename simple: lowercase, no spaces, like my-board.png.

EXAMPLE 3Get AI to explain the code
YouExplain this code line by line, for an 11-year-old who is learning HTML: <ul><li>Ollie</li><li>Kickflip</li></ul>
AILine 1: <ul> starts a bullet list (ul means "unordered list").
Line 2: <li>Ollie</li> is one item in the list.
Line 3: <li>Kickflip</li> is another item.
Line 4: </ul> closes the list.
YouSo if I wanted numbers instead of bullets, what would I change?
AIChange <ul> to <ol> and </ul> to </ol>. ol means "ordered list".

Asking "line by line" and then a follow-up question (from Talk Back!) is the fastest way to really understand your code.

Part 3 · Spot it

Match the Tag

Which tag would you use to make each part of the page?

Tag master! 🧱

Part 4 · Build it

Build a Favorite Things Section

Add a "favorite things" section to this page. Type the tags yourself, and the goals tick off as you go. Stuck? Look back at Example 1.

πŸ“„ index.html
Live preview

    The playground only runs inside this page. It can't open other websites or change anything on your computer. Your code is saved in this browser, on this device.

    Byte says

    The picture won't show in the playground, because there's no picture file here. That's fine! You'll see your alt text instead. That's exactly what alt text is for.

    Part 5 · Try it for real

    Building Block Missions

    Time to use your own chatbot. Missions get harder as you go. Bronze is the one to do today. Silver and Gold are extra challenges for when you want more.

    β˜… Bronze

    Hand-Built Section

    Add a new section to your real website, typed by you.

    1. Open your index.html in your text editor.
    2. Add an h2 heading, a paragraph and a list of at least 3 things, all typed by hand.
    3. Save, refresh and check it looks right. If it doesn't, check that every tag is closed.
    β˜…β˜… SilverExtra challenge

    Picture Time

    Add your first picture.

    1. Draw something or take a photo of an object (not people). Save it in your my-website folder with a simple name.
    2. Add an <img> tag with the exact filename and good alt text.
    3. Refresh. If the picture doesn't appear, check the filename letter by letter.
    β˜…β˜…β˜… GoldExtra challenge

    Teach It Back

    Understand every line.

    1. Ask your AI tool to explain your whole page line by line, for someone your age.
    2. Ask at least one follow-up question about a part you weren't sure of.
    3. Teach one tag to someone at home. Teaching is the best way to check you understand!

    Your notes are saved right in this browser, on this device. They're never sent anywhere.

    Part 6 · Build Log

    Add a page to your Build Log

    Add today's page to your Build Log.

    πŸ› οΈ HTML Building Blocks

    PAGE 2 OF 6

    Your Build Log is saved right in this browser, on this device. It's never sent anywhere.

    Recap

    What you just learned

    Part 7 · Show what you know

    Quick Quiz

    10 questions, picked at random from a bigger question bank. If you take it again, you'll probably see a different mix. Let's go!

    Up next

    Lesson 3 · Style It with CSS

    Give your site colors, fonts and style.

    Go to Lesson 3 →