Headings, paragraphs and text

How to structure text so it reads well, ranks well, and works for screen readers — including the heading levels everyone gets wrong.

Headings form an outline

There are six heading levels, <h1> through <h6>. Think of them as a document outline, not as font sizes. Skip levels and the outline breaks for anyone navigating by structure.

  • Use exactly one <h1> per page — it is the page's title.
  • Move to <h2> for top sections, <h3> for subsections.
  • Never pick a heading level because it 'looks right'; style with CSS instead.
💡
Screen reader users commonly jump heading to heading. A clean outline is the single cheapest accessibility win available.

Paragraphs and inline meaning

<h2>Getting started</h2>
<p>HTML describes <strong>structure</strong>, and CSS <em>appearance</em>.</p>
<p>Some terms need care: <code>&lt;div&gt;</code> has no meaning,
  while <abbr title="HyperText Markup Language">HTML</abbr> does.</p>
ElementMeaningUse for
<p>ParagraphBlocks of prose
<strong>Strong importanceGenuine emphasis — not just bold
<em>Stress emphasisChanging the meaning of a sentence
<code>Fragment of codeIdentifiers, snippets
<pre>Preformatted blockMulti-line code; preserves whitespace
<abbr>AbbreviationExpansions in the title
<blockquote>Quoted passageBlock-level citation
<br>Line breakAddresses and poems only — never spacing

Escaping special characters

Three characters need care because they belong to the markup itself. To display them literally, use entities.

CharacterEntityWhy
<&lt;Otherwise starts a tag
>&gt;Optional, but consistent practice
&&amp;Otherwise starts an entity

Inside most quoted attribute values only & and the quote character itself are problematic. Whitespace in normal text collapses to a single space — that is why multi-line code belongs in <pre>.

FAQ

Why does my line break not show up?
HTML collapses whitespace. Use two separate block elements, or CSS margins. <br> is for genuine line breaks inside a block (poetry, addresses).
strong vs b, em vs i?
strong/em carry meaning (importance, stress); b/i historically meant 'draw attention' without semantics. Prefer the meaningful pair.

Elements and attributes Semantic layout

Last refreshed 2026-09-17.