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.
<!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>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
- Change “Hello, world!” to your name.
- Add a second
<p>paragraph under the first one. - 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.
Exercise 1Solved
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>It is the word that comes right after
<!at the top of every example in this lesson.Exercise 2Solved
Visible content goes inside one element. Fill in its start and end tags.
<html> <head> <title>My page</title> </head> <> <h1>Welcome</h1> </> </html>The
<head>holds information about the page. Its partner holds what you see.
Finish the practice to complete this lesson.
Sign in to keep your progress on any device.