Headings, paragraphs and text
Organise text with six levels of headings, paragraphs, line breaks and emphasis.
Six levels of headings
Headings go from <h1> (most important) to <h6> (least). Use them like the outline of a document, not just to make text big: search engines and screen-reader users rely on them to understand and move around your page.
<h1>Youth Conference 2026</h1>
<h2>Programme</h2>
<h3>Day one</h3>
<p>Registration starts at 9 a.m.</p>
<h3>Day two</h3>
<p>Workshops all afternoon.</p>
Paragraphs and line breaks
Each paragraph goes in its own <p>. The browser ignores extra spaces and new lines in your code, so pressing Enter in your file does not start a new line on the page.
<p>This has lots of
spaces, but shows as one line.</p>
<p>Line one<br>Line two</p>
<hr>
<p>A new section after a horizontal rule.</p>
This has lots of spaces, but shows as one line. Line one Line two ──────────── A new section after a horizontal rule.
Meaningful text elements
| Element | Meaning | Usually looks |
|---|---|---|
| <strong> | Important | Bold |
| <em> | Stressed (spoken with emphasis) | Italic |
| <mark> | Highlighted for reference | Yellow background |
| <small> | Side comment, fine print | Smaller |
| <blockquote> | A quotation from somewhere else | Indented |
| <code> | A piece of computer code | Monospace |
<p>Bring your <strong>registration slip</strong> on the <em>first</em> day.</p>
<blockquote>Train up a child in the way he should go.</blockquote>
<p>Type <code>npm start</code> to run the app.</p>
Exercise
Write a short article: an <h1> title, two <h2> sections, a paragraph under each, and one important phrase marked with <strong>.
<h1></h1>
Show a possible solution
<h1>Why I am learning to code</h1>
<h2>My goal</h2>
<p>I want to build a <strong>website for my parish</strong>.</p>
<h2>My plan</h2>
<p>One lesson every day, then practise in the Playground.</p>
Check your understanding
Quick check
How many <h1> headings should a page usually have?
Quick check
Which tag marks text as important?
Quick check
You press Enter three times inside a <p> in your file. What does the browser show?