Text elements and structure
โ Report an issue with this lessonHeadings and paragraphs are the two tags you'll use constantly. HTML has six heading levels, from most to least important:
<h1>Page title</h1>
<h2>Section title</h2>
<h3>Subsection title</h3>
Use exactly one <h1> per page -- it should describe
what the whole page is about. Use <h2> and below for
everything after that.
Paragraphs and line breaks
<p>This is a paragraph. It can span as many
lines in your code as you want -- the browser
collapses them into one flowing block of text.</p>
Don't use multiple <br> tags to create spacing between
paragraphs -- that's what CSS margins are for. Save <br>
for genuine line breaks inside content, like a mailing address.
Bold and italic
<p>This is <strong>important</strong> and this is
<em>emphasized</em>.</p>
Use <strong> and <em> rather than
the older <b> and <i> -- they carry
meaning, not just a visual style, which matters for screen readers.
Try it yourself
Exercise: Add an <h2> subheading and a second paragraph below the first one.
// that was the last free lesson
11 more lessons โ including Project: build a simple portfolio page โ plus a certificate are waiting.
Unlock the full course โ $29.99