CPCODELAB
HTML

Headings and Paragraphs

7 min read

Organising Text Content

HTML provides six heading levels<h1> through <h6> — and the <p> tag for paragraphs. Headings convey hierarchy and importance; paragraphs hold the body text.

html
<h1>Main Page Title</h1>
<p>An introductory paragraph that explains the topic.</p>

<h2>First Section</h2>
<p>More detail about the first section.</p>

<h3>A Sub-section</h3>
<p>Even more specific content here.</p>

Use only one `<h1>` per page. Skipping heading levels (e.g. jumping from <h2> to <h4>) harms accessibility and SEO. Headings create a logical outline — do not choose them based on their default font size.

Browsers automatically add whitespace between paragraphs, so you never need blank lines inside HTML to create visual gaps. That spacing is controlled by CSS later.

Ready to test yourself?
Practice HTML— quiz & coding exercises