Chapter 1 · The basics·8 min read

What HTML is, and how a page is put together

Before you write any tags, it helps to know what a web page actually is: a text file the browser reads and turns into what you see on screen.

Chapter 1 · The basicsLesson 1 of 6
0 of 6 lessons complete across this handbook

HTML is a markup language

HTML is not a programming language. Programming languages make the computer do things. HTML describes the meaning of your content. You put text inside tags, and the tags tell the browser, 'this part is a heading', 'this part is a paragraph', 'this part is a link'.

A tag is written with angle brackets. Most tags come in pairs: an opening tag and a closing tag. The closing tag has a forward slash. For example, a heading starts with <h1> and ends with </h1>.

The four parts of every page

A complete HTML page has four main parts. The DOCTYPE tells the browser this is HTML5. The <html> tag wraps everything. The <head> holds information about the page, like its title, which you do not see on the page itself. The <body> holds everything you do see — headings, paragraphs, images, links.

A useful mental model

Think of HTML like packing a suitcase. Each item gets its own box, and the box has a label. The browser unpacks the boxes and shows you the items in the order they were packed.

html
<!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>

Knowledge checkpoint

Verifies: HTML structure

Which part of the page holds the content you can see in the browser?