HTMLLesson 1 of 10Jump to practice

What is HTML?

HTML is the language that gives a web page its structure. Write your first page in two minutes.

Every web page you have ever visited is built from HTML (HyperText Markup Language). HTML doesn’t make things move or look pretty. Its job is to say what each piece of content is: this is a heading, this is a paragraph, this is a link.

Your browser reads that HTML and turns it into the page you see.

Your first page

Here is a complete HTML page. Press Run to see it, then change the words and run it again.

A complete HTML page
Open in editor
<!DOCTYPE html>
<html>
<head>
<title>My first page</title>
</head>
<body>

<h1>Hello, world!</h1>
<p>This is my first web page.</p>

</body>
</html>
Result

What each line does

Code What it means
<!DOCTYPE html> Tells the browser this is a modern HTML page
<html> Wraps the whole page
<head> Information about the page, like its title. Not shown on the page itself
<title> The text shown in the browser tab
<body> Everything visible on the page goes in here
<h1> A main heading
<p> A paragraph

Try this

  1. Change “Hello, world!” to your name.
  2. Add a second <p> paragraph under the first one.
  3. Press Run, or use Ctrl+Enter (Cmd+Enter on a Mac).

Practice

Check what you just learned. Fill in the missing code, then answer the quiz.

  1. Exercise 1

    Every page starts by telling the browser it is a modern HTML page. Complete the first line.

    <! html>
    <html>
    <body>
      <p>Hello</p>
    </body>
    </html>

  2. Exercise 2

    Visible content goes inside one element. Fill in its start and end tags.

    <html>
    <head>
      <title>My page</title>
    </head>
    <>
      <h1>Welcome</h1>
    </>
    </html>

Quiz: 3 questions

1. What does HTML describe?
2. Where does the text in <title> appear?
3. Which element holds everything that is visible on the page?

Finish the practice to complete this lesson.