Lesson 2 of 14 · 6 min

Headings and paragraphs

A real page has more than one heading. HTML has six levels, from <h1> (most important) down to <h6>. Use them like the headings in a report:

<h1>Tariro Moyo</h1>
<h2>About me</h2>

Use one <h1> per page for its main title, and <h2> for each section below it. Pick the level by importance, not by size: you can change how big things look later with CSS.

Ordinary text goes in paragraphs, with the <p> tag:

<p>I live in Harare and I am learning to build websites.</p>
<p>In my free time I play football and cook.</p>

One thing surprises everyone at first: HTML ignores extra spaces and line breaks in your text. Pressing Enter inside a paragraph does not start a new line on the page. If you want a new paragraph, close the old one and open a new <p>.

Your task

Turn the starter into a short page about you:

  1. Change the <h1> so it shows your own name.
  2. Under it, add an <h2> heading that says About me.
  3. Under that, write two paragraphs about yourself, each in its own <p>.
index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>About me</title>
</head>
<body>
  <h1>Your name</h1>

  <!-- Add an h2 heading and two paragraphs below -->

</body>
</html>

Your page

Discussion

Stuck? Ask here. Be kind, and share hints rather than full answers.

Loading the discussion…