๐Ÿš€

Build Your First Web Page!

Today you will make an All About Me page. Then you can show it to a friend!

โฐ 1 hour ๐Ÿท๏ธ HTML ๐Ÿ† Bonus challenges

๐Ÿ•ต๏ธ Warm-up: Be a website hacker!

Every website is made of code. Your browser has a secret tool to see it. It is called Inspect. Let's use it to change the news below!

๐Ÿ“ฐ The Daily Giggle

BREAKING: Dogs are learning to drive buses ๐Ÿถ๐ŸšŒ

Experts say the dogs are very good at the steering. They are not good at the tickets.

Do this:

  1. Right-click on the headline. (On a Chromebook, tap with two fingers.)
  2. Click Inspect. A box full of code pops up!
  3. Find the words of the headline in the code. Double-click them.
  4. Type your own silly headline. Press Enter.
  5. Look! The web page changed! ๐Ÿคฏ
๐Ÿงช Try this! Change the headline to something about YOU. Maybe โ€œLocal kid becomes pizza championโ€!
๐Ÿคซ Is it real? No! The change is only on your screen. Press refresh (F5) and it goes back. You did not break the real website. Phew!

Inspect not working? Ask your Code Club leader, or press this magic button:

๐Ÿฅช What is a website?

A web page is a file with words in it. It also has tags. Tags tell the browser what each part is.

Web pages use a language called HTML. Browsers can read it. And today, so can you!

A tag is like a sandwich ๐Ÿฅช

You need a slice of bread at the top and a slice at the bottom. Your words are the filling!

HTML
<h1>Hello!</h1>
๐Ÿ‘€ Spot it! The closing tag has a slash / in it. The slash means โ€œstop hereโ€.

Tags we will use today

TagWhat it means
<h1>A big heading. Like a title.
<h2>A smaller heading.
<p>A paragraph. Some sentences.
<ul>A list with bullet points โ€ข
<li>One list item. It goes inside the list.
<img>An image. A picture!

๐Ÿ› ๏ธ Let's build!

Get ready

Make your web page file

A web page is just a text file. Its name ends in .html. You will make one now!

Pick your computer:

๐ŸชŸ Windows laptop (Notepad)
  1. Click Start. Type Notepad. Open it.
  2. Click ๐Ÿ“‹ Copy on the starter code below. Paste it into Notepad. (Ctrl + V)
  3. Click File, then Save as.
  4. Pick the Desktop. Make a new folder. Call it my-website. Open it.
  5. Find Save as type. Change it to All files.
  6. For the file name, type index.html. Click Save.
  7. Open your my-website folder. Double-click index.html. It opens in the web browser. That's your page! ๐ŸŽ‰
๐Ÿ’ป Chromebook (Text app)
  1. Click the Launcher (the circle in the corner). Type Text. Open the Text app.
  2. Click ๐Ÿ“‹ Copy on the starter code below. Paste it in. (Ctrl + V)
  3. Press Ctrl + S to save.
  4. Pick My files. Make a new folder called my-website.
  5. Call the file index.html. Click Save.
  6. Open the Files app. Find index.html. Right-click it. Pick Open with, then Chrome. ๐ŸŽ‰
๐ŸŽ Mac (TextEdit)
  1. Open TextEdit. Click New Document.
  2. Click Format, then Make Plain Text. (This is important!)
  3. Click ๐Ÿ“‹ Copy on the starter code below. Paste it in. (โŒ˜ Cmd + V)
  4. Press โŒ˜ Cmd + S. Make a folder on the Desktop called my-website.
  5. Call the file index.html. Click Save. If it asks, click Use .html.
  6. In Finder, right-click index.html. Pick Open With, then Safari or Chrome. ๐ŸŽ‰

Your starter code

HTML
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>All About Me</title>
  </head>
  <body>

    <!-- Hi! I am a COMMENT. The computer ignores me. -->
    <!-- Comments are notes for humans. Follow the steps! -->

    <!-- STEP 1: Change "Your Name" to your FIRST name -->
    <!-- STEP 2: Put your favourite emoji after your name -->
    <h1>All About Your Name</h1>

    <!-- STEP 3: Write one sentence to say hello -->
    <p>Hello! Welcome to my page.</p>

    <!-- STEP 4: Write 3 facts about you. One fact in each li -->
    <h2>Three facts about me</h2>
    <ul>
      <li>Fact number 1</li>
      <li>Fact number 2</li>
      <li>Fact number 3</li>
    </ul>

    <!-- STEP 5 (if you want): Add a picture on the line below -->


  </body>
</html>
๐Ÿค” What are the lines that start with <!--? Those are comments. They start with <!--. The computer skips them. They are notes for you!
๐Ÿ™ˆ What is the stuff at the top? That is the page's secret settings. Don't worry about it today. You will write your things between <body> and </body>.
๐Ÿ›ก๏ธ Stay safe online! Only use your first name. Don't write where you live or the name of your school. Don't use a photo of yourself.

๐Ÿ” The magic loop

Keep two windows open: your text file and your web browser. Every time you change something, do this:

โœ๏ธ1. TypeChange your code
๐Ÿ’พ2. SaveCtrl + S
๐Ÿ”„3. RefreshClick the browser, press F5

On a Mac, use โŒ˜ Cmd + S to save and โŒ˜ Cmd + R to refresh. On a Chromebook, refresh with Ctrl + R.

Step 1

Put your name in a heading

Find the <h1> line. Change Your Name to your first name. Keep the tags! Only change the words in the middle.

HTML
<h1>All About Sam</h1>

Save ๐Ÿ’พ then refresh ๐Ÿ”„ your browser. Your name is big and bold!

๐Ÿงช Try this! Change h1 to h2 in both tags. What happens? Now try h6! Change it back to h1 when you are done.
HTML
<h2>All About Sam</h2>
Step 2

Add your favourite emoji

Put an emoji after your name. It goes inside the heading, before </h1>.

HTML
<h1>All About Sam ๐ŸฆŠ</h1>

Click an emoji to copy it. Then paste it in your code.

Want a different one? On Windows press โŠž Win + . ยท On a Chromebook press Search + Shift + Space ยท On a Mac press Ctrl + โŒ˜ + Space

๐Ÿงช Try this! Can you put three emojis in a row? ๐ŸฆŠ๐Ÿ•โšฝ
Step 3

Say hello

A <p> tag holds a paragraph. Change the words to your own hello.

HTML
<p>Hello! This is my very first web page.</p>
๐Ÿงช Try this! Copy your <p> line. Paste it again underneath. Now you have two paragraphs! Write something new in the second one.
Step 4

Three facts about you

This is a list. The <ul> tag is the box. Each <li> is one thing in the box.

Write one fact inside each <li>. What makes you YOU?

HTML
<h2>Three facts about me</h2>
<ul>
  <li>I have a dog called Biscuit.</li>
  <li>My favourite food is pizza.</li>
  <li>I can do a cartwheel.</li>
</ul>

๐Ÿ’ก Ideas: a pet, a food you love, a sport, a game, something you can do, a place you want to visit.

๐Ÿงช Try this! Change ul to ol (at the top and the bottom of the list). The dots turn into numbers! 1, 2, 3!
HTML
<ol>
  <li>I have a dog called Biscuit.</li>
  <li>My favourite food is pizza.</li>
  <li>I can do a cartwheel.</li>
</ol>

Can you add a fourth fact? Copy an <li> line and paste it.

Step 5 ยท if you want

Add a picture

The <img> tag shows a picture. It is a lonely tag. It has no closing tag!

Click a picture to copy its code. Paste it where it says STEP 5.

HTML
<img src="https://YOUR-SITE.vercel.app/session-1/images/rocket.svg" alt="A pink rocket" width="200">
srcWhere the picture lives on the internet.
altWords that describe the picture. This helps people who can't see it.
widthHow wide the picture is.
๐Ÿงช Try this! Change width="200" to width="50". Tiny! Now try width="400". Huge!
Finished!

Your code might look like this

Here is Sam's page. Yours will have your name and facts. See Sam's page live ๐Ÿ‘€

HTML
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>All About Sam</title>
  </head>
  <body>

    <!-- My name and my favourite emoji -->
    <h1>All About Sam ๐ŸฆŠ</h1>

    <!-- A sentence to say hello -->
    <p>Hello! This is my very first web page.</p>

    <!-- Three facts about me -->
    <h2>Three facts about me</h2>
    <ul>
      <li>I have a dog called Biscuit.</li>
      <li>My favourite food is pizza.</li>
      <li>I can do a cartwheel.</li>
    </ul>

    <!-- A picture I like -->
    <img src="https://YOUR-SITE.vercel.app/session-1/images/rocket.svg" alt="A pink rocket" width="200">

    <p>Thanks for visiting my page! ๐Ÿ‘‹</p>

  </body>
</html>
๐Ÿ˜ Does it look a bit plain? Good! That is what HTML looks like on its own. It is the skeleton of a web page. Next time we will add the fun colours! Scroll to the bottom for a sneak peek. ๐Ÿ‘‡

๐Ÿ› Stuck? Go bug hunting!

  • Did you forget the slash in a closing tag? </h1>
  • Does every < have a >?
  • Is every word spelled right? <li> not <il>
  • Did you save ๐Ÿ’พ and then refresh ๐Ÿ”„?
  • Does the browser show your code as plain text? Your file might be called index.html.txt. Ask a grown-up to help you rename it.
  • Still stuck? Put your hand up. Bugs happen to every coder! ๐Ÿ™‹

๐ŸŽ‰ Show a friend!

Tick off each thing. When they are all done, show your page to a friend!

๐Ÿ—ฃ๏ธ When you show a friend: Point to one tag and tell them what it does. You are teaching! Then ask them to show you their page.

โญ Bonus challenges

Finished early? Amazing! Pick any challenge. Add it to your page.

โญ Warm-up challenges

Bold and slanty

<strong> makes words bold. <em> makes them slanty.

HTML
<p>I <strong>love</strong> pizza. It is <em>so</em> tasty!</p>

Highlighter pen

<mark> makes words look highlighted.

HTML
<p>My best subject is <mark>art</mark>.</p>

My top 3

Make a numbered list of your top 3 things. Animals? Games? Snacks?

HTML
<h2>My top 3 animals</h2>
<ol>
  <li>Fox ๐ŸฆŠ</li>
  <li>Owl ๐Ÿฆ‰</li>
  <li>Shark ๐Ÿฆˆ</li>
</ol>

โญโญ Tricky challenges

Secret message ๐Ÿคซ

Hide a secret! It only shows when someone clicks. Try it on a friend!

HTML
<details>
  <summary>Click for a secret! ๐Ÿคซ</summary>
  <p>I once ate 7 pancakes in one go.</p>
</details>

Hover mystery

Point your mouse at the words. A hidden message pops up!

HTML
<p>My pet is a <abbr title="He is a golden retriever!">good boy</abbr>.</p>

A poem with new lines

<hr> draws a line. <br> starts a new line. Both are lonely tags!

HTML
<hr>
<p>Roses are red,<br>
violets are blue,<br>
I made a web page,<br>
and you can too!</p>

Make a link

<a> makes a link you can click. href is where it goes.

HTML
<a href="https://codeclub.org">Visit Code Club</a>

Only link to websites a grown-up says are OK.

โญโญโญ Boss level

Quiz about me

Use lots of secret messages to make a quiz! Can your friend guess the answers?

HTML
<h2>Quiz: guess about me!</h2>
<details>
  <summary>What is my favourite colour?</summary>
  <p>Green! ๐Ÿ’š</p>
</details>
<details>
  <summary>What animal scares me?</summary>
  <p>Geese! ๐Ÿชฟ</p>
</details>

Table of favourites

A table has rows <tr> and boxes <td>. <th> is a heading box.

HTML
<h2>My favourite things</h2>
<table border="1">
  <tr>
    <th>Thing</th>
    <th>My favourite</th>
  </tr>
  <tr>
    <td>Food</td>
    <td>Pizza ๐Ÿ•</td>
  </tr>
  <tr>
    <td>Game</td>
    <td>Tag ๐Ÿƒ</td>
  </tr>
</table>

Can you add another row?

Emoji art

<pre> keeps all your spaces. Draw a picture with emojis!

HTML
<pre>
    โญ
   ๐ŸŸฉ๐ŸŸฉ
  ๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ
 ๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ
    ๐ŸŸซ
</pre>

A whole new part

Add a new section to your page. Use a heading, a paragraph and a picture. All by yourself!

HTML
<h2>When I grow up</h2>
<p>I want to be an astronaut!</p>
<img src="https://YOUR-SITE.vercel.app/session-1/images/planet.svg" alt="A purple planet with a ring" width="150">

๐Ÿ”ฎ Sneak peek: next time!

Today you built the skeleton of your page with HTML. ๐Ÿ’€

Next time you will learn CSS. CSS is like clothes and paint for your page. Look what it can do!

All About Sam ๐ŸฆŠ

Hello! This is my very first web page.

Three facts about me

  • I have a dog called Biscuit.
  • My favourite food is pizza.
  • I can do a cartwheel.

Today: just HTML ๐Ÿ˜

All About Sam

  • ๐Ÿถ I have a dog called Biscuit.
  • ๐Ÿ• My favourite food is pizza.
  • ๐Ÿคธ I can do a cartwheel.

Next time: HTML + CSS ๐Ÿคฉ

Same words. Brand new look. See you next time! ๐Ÿ‘‹