Stop 03 · HTML FundamentalsTopics · 2/10

Headings, Paragraphs and Lists

Part of the Web Development Roadmap

In short

Most of the web is text. Headings, paragraphs and lists turn a wall of words into something people can scan, and they help Google and screen readers understand your page.

Headings from h1 to h6 give a page its outline, paragraphs hold blocks of text, and ordered and unordered lists group related items.

The jaadu sits on a park bench holding open a large newspaper, running a finger down the bold headlines of each story.

Think of it like this

A newspaper page

A newspaper has one giant front-page headline, smaller headlines for each story, paragraphs of text under each one and boxed lists like 'today's weather'. You can scan the page in seconds because of that structure. h1 to h6, p, ul and ol give your page the same shape.

Watch it happen

The outline of a recipe page

h1: Masala Chai
h2: Ingredients
ul: tea, milk, ginger
h2: Method
ol: steps 1 to 4

1/4One h1 names the whole page.

The big ideas

What you need to know

One h1 per page

The h1 is the page's main title. Use h2 for sections and h3 for sub-sections inside them.

Don't skip levels

Go h1, h2, h3 in order. Pick headings by meaning, then use CSS to change their size.

Paragraphs for text

Wrap each block of text in <p>. Don't use lots of <br> tags to create spacing; use CSS margin.

ul vs ol

ul for bullets where order doesn't matter, ol for numbered steps. Each item is an li, and lists can nest.

See it in code

Walk through the code

html
1<h1>Masala Chai</h1>2<p>A warm, spiced tea made in every home in India.</p>3 4<h2>Ingredients</h2>5<ul>6  <li>2 cups water</li>7  <li>1 cup milk</li>8  <li>2 tsp tea leaves</li>9  <li>A small piece of ginger</li>10</ul>11 12<h2>Method</h2>13<ol>14  <li>Boil the water with crushed ginger.</li>15  <li>Add tea leaves and simmer for 2 minutes.</li>16  <li>Pour in milk and bring to a boil.</li>17  <li>Strain into cups and serve hot.</li>18</ol>

1/3The page title and a short intro paragraph.

A clean recipe outline. Even without any CSS, it's easy to read.

Save yourself the pain

Common mistakes

Oops

Using <h4> because you want small bold text.

Do this instead

Choose headings by their place in the outline. For small bold text use <strong> or CSS.

Oops

Putting text straight inside <ul> without <li>.

Do this instead

Every list item must be wrapped in <li>. Only li elements may be direct children of ul and ol.

Your mission

Write your own recipe page

~20 min

Quick check

Which list should you use for the steps to install a software?

Go deeper

  1. 1Use only one h1 per page and never skip heading levels just for size.
  2. 2Build a recipe page with a heading, an ingredients list and numbered steps.
  3. 3Check your page's outline with a browser extension that shows the heading structure.

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge