🌐
Coding🎓 Ages 14-18Beginner 10 min read

Build a Simple Web Page with HTML

A teen HTML tutorial: build your first web page from scratch. Learn tags, headings, paragraphs, links, images, and lists, and see the full page structure. With a quiz.

Key takeaways

  • HTML uses tags written in angle brackets, and most come in opening/closing pairs
  • Every page has a basic structure: <!DOCTYPE html>, <html>, <head>, and <body>
  • Headings (<h1>-<h6>), paragraphs (<p>), and lists organize content
  • Links use the <a href> tag and images use the self-closing <img> tag with src and alt
  • Save the file with a .html extension and open it in any web browser to view it

What is HTML?

HTML stands for HyperText Markup Language. It's the language that builds the structure of every web page on the internet. When you visit a website, your browser reads HTML and turns it into the headings, paragraphs, images, and links you see.

HTML isn't a programming language like Python — it doesn't have loops or decisions. Instead, it's a markup language: it labels content so the browser knows what each part is.

Tags are the building blocks

HTML is made of tags, written inside angle brackets. Most tags come in pairs: an opening tag and a closing tag with a /. The content goes between them:

<p>This is a paragraph.</p>

Here <p> opens the paragraph and </p> closes it. The browser knows everything between them is one paragraph.

The page skeleton

Every HTML page starts with the same basic structure. Here it is:

<!DOCTYPE html>
<html>
  <head>
    <title>My First Web Page</title>
  </head>
  <body>
    <h1>Hello, web!</h1>
    <p>This is my very first web page.</p>
  </body>
</html>

Let's break it down:

  • <!DOCTYPE html> tells the browser this is a modern HTML page.
  • <html> wraps the entire page.
  • <head> holds information about the page, not shown on the page itself. The <title> sets the text in the browser tab.
  • <body> holds everything you actually see on the page.

Type this into a text editor, save it as index.html, and open it in any web browser. You've made a web page!

Headings and paragraphs

HTML has six heading levels, from <h1> (biggest, most important) down to <h6> (smallest):

<h1>My Cooking Blog</h1>
<h2>Breakfast Recipes</h2>
<h3>Pancakes</h3>
<p>Pancakes are easy to make and delicious.</p>

Use <h1> once for the main title, then <h2> and <h3> for sections and subsections. Regular text goes in <p> paragraph tags.

Links are what make the web a web. They use the <a> (anchor) tag with an href attribute that holds the destination:

<a href="https://www.wikipedia.org">Visit Wikipedia</a>

An attribute is extra info inside the opening tag, written as name="value". Here href is the attribute and the URL is its value. The text between the tags is what the user clicks.

Adding images

Images use the <img> tag. It's a self-closing tag — it has no closing partner because it holds no text content:

<img src="cat.jpg" alt="A fluffy orange cat sleeping">

Two attributes matter here:

  • src — the path or web address of the image file.
  • alt — alternative text that describes the image. Screen readers read it aloud, and it appears if the image fails to load. Always include alt for accessibility.

Making lists

For a set of items, use lists. An unordered list (<ul>) shows bullets, and an ordered list (<ol>) shows numbers. Each item goes in an <li> (list item) tag:

<ul>
  <li>Apples</li>
  <li>Bananas</li>
  <li>Cherries</li>
</ul>

<ol>
  <li>Wake up</li>
  <li>Brush teeth</li>
  <li>Eat breakfast</li>
</ol>

A complete example

Here's a full page that uses everything you've learned:

<!DOCTYPE html>
<html>
  <head>
    <title>About Me</title>
  </head>
  <body>
    <h1>About Me</h1>
    <p>Hi! I'm learning to build web pages.</p>

    <h2>My Hobbies</h2>
    <ul>
      <li>Coding</li>
      <li>Drawing</li>
      <li>Soccer</li>
    </ul>

    <h2>A Link I Like</h2>
    <p><a href="https://www.wikipedia.org">Wikipedia</a> is great for research.</p>
  </body>
</html>

Save it as a .html file, open it in a browser, and you have a real web page you can share.

Where to go next

HTML gives a page its structure. To control how it looks — colors, fonts, layout — you'd next learn CSS, and to add interactivity you'd use JavaScript. The same logic skills from Loops: Making the Computer Repeat carry straight over.

Practice challenges

  • Build a page about your favorite movie with a heading, two paragraphs, and a list of characters.
  • Add a link to the movie's official website.
  • Add an image with a clear, descriptive alt attribute.

Quick quiz

Test yourself and earn XP

What does HTML stand for?

Which tag creates the biggest, top-level heading?

Which is the correct way to make a link?

What does the alt attribute on an <img> do?

Where does the visible content of a page go?

FAQ

No. Any plain text editor works, and you view the page by opening the saved .html file in a web browser. Free code editors make it easier with color highlighting.

HTML is a markup language: it describes the structure and content of a page. Python is a programming language with logic, loops, and decisions. They do different jobs.