Learn / Programming / Your first web page

So meanwhile... build a web page.

Type a few lines of HTML and watch a real web page appear. No installing anything.

10 minutes, beginner

HTML: your first web page

By the end you’ll have written headings, paragraphs and a list, and you’ll know what a tag is.

1. Say it

HTML is made of tags. Each one tells the browser what kind of thing you’re writing. Here are the ones you’ll use today.

TagWhat it doesExample
<h1>The biggest heading<h1>Hello</h1>
<h2>A smaller heading<h2>My hobbies</h2>
<p>A paragraph of text<p>Nice to meet you.</p>
<strong>Important text (shown bold)<strong>Look!</strong>
<em>Emphasised text (shown italic)<em>really</em>
<ul> and <li>A bulleted list, and each item in it<ul><li>Tea</li></ul>

Tip: You can’t break anything here. If the page looks odd, press “Start again” in the editor below and it goes back to the beginning.

2. Know it

Most tags come in pairs. There’s an opening tag like <p> and a closing tag like </p>, which has a slash. Whatever sits between them is the content. The whole thing is called an element.

Computers do exactly what you write, not what you meant. Forget a closing tag and the page can look wrong. That’s normal, and spotting the missing bit is a big part of coding.

One honest note: HTML describes what’s on a page, so it’s called a markup language rather than a programming language. Languages like JavaScript make pages do things. HTML is where nearly everyone starts.

3. Use it

Edit the code on the left. The page on the right updates as you type. Then try the three challenges.

  • Challenge 1: change the heading to your own words.To do
  • Challenge 2: add a second paragraph.To do
  • Challenge 3: add a bulleted list with at least three items.To do

Stuck on the list? A list is a <ul> with one <li> for each item: <ul><li>Tea</li><li>Toast</li><li>Jam</li></ul>

The preview only shows HTML. Nothing you type here is saved or sent anywhere.

4. Check it

1. What does HTML stand for?

2. Which tag makes the biggest heading?

3. Which tag closes a paragraph?

4. Which pair of tags makes a bulleted list?

5. What does <strong> do?

Done!

You’ve written real HTML and seen it turn into a web page.

Go further