Lesson 3 of 23

In progress

Course progress

HTML and CSS

Headings, paragraphs and text emphasis

Build a readable document outline with h1 to h6, write paragraphs people can scan, and use emphasis that carries meaning.

Headings are not font sizes. They are the outline of your document, and that outline is what a screen reader user navigates by, what a search engine reads, and what a reader skims before deciding to stay.

What you will learn

  • Use h1 to h6 in a logical order.
  • Write paragraphs that survive narrow screens and long reading sessions.
  • Use strong and em for meaning rather than appearance.

One topic, one h1

The h1 states the page’s subject. Every other heading sits beneath it in a sensible hierarchy: h2 for major sections, h3 for subsections of those.

HTML
Editable. Runs in your browser.





Press Run to see the output.

The h3 belongs to Grid because it is nested inside that section. Do not skip from h2 to h4 because the size looks better; that tells assistive technology a level is missing. Size is CSS’s job.

If a page genuinely has two unrelated main topics, it probably wants two pages. A single h1 keeps the outline honest.

Paragraphs are the unit of reading

A p holds a thought, not a line. Browsers wrap it to the viewport, so never press Enter to force a line break in the middle of a sentence.

HTML
Editable. Runs in your browser.





Press Run to see the output.

Each p gets vertical space from the browser’s default styles. If you need a new line inside a paragraph — an address, a poem, a short line of code — use br. Using br between paragraphs is a sign you wanted two paragraphs.

Long paragraphs are hard to read on any screen. Three to five sentences is a comfortable length on the web, and a blank line between ideas costs nothing.

Emphasis that means something

strong marks importance, em marks stress. Browsers render them bold and italic by default, but the tags carry meaning that b and i do not.

HTML
Editable. Runs in your browser.





Press Run to see the output.

Use strong sparingly. A page where everything is important has no emphasis left. If you only want bold text for visual reasons and there is no importance, that is a CSS decision.

Code, file names and keyboard keys have their own elements: code, kbd, samp. They also default to a monospace font, but their meaning is more specific than a generic span.

Blocks stack, inline flows

Headings and paragraphs are block elements: each starts on a new line and takes the available width. strong, em, a and code are inline: they sit inside a line of text.

HTML
Editable. Runs in your browser.





Press Run to see the output.

Putting a block element inside a paragraph is invalid. A div or h2 inside p causes the browser to close the paragraph early, which produces a DOM you did not write. The Elements panel shows this immediately, and it is worth checking when a layout behaves strangely.

Readable text is a design decision

Line length matters. A paragraph stretching across a wide monitor is tiring; something around 60 to 75 characters per line is comfortable. CSS handles that with a maximum width, not with manual line breaks.

Also avoid writing in all capitals for whole paragraphs. It slows reading, and screen readers may spell out abbreviations. If you want capitals for a visual style, use text-transform in CSS later.

Using an empty heading or a heading purely for spacing, such as <h2>&nbsp;</h2>, creates a phantom section in the outline. Screen reader users hear "heading level 2" with nothing after it. Use margin for space and headings for names.

Write a short page about a hobby. Give it one h1, two h2 sections, and one h3 under the second section. Include a paragraph, one strong, one em, and one paragraph with a br where a line break is genuinely part of the content.

Show solution
HTML
Editable. Runs in your browser.





Press Run to see the output.

The br separates two lines that are meant to be read as separate lines. Everything else is a real paragraph, and the headings nest without skipping a level.

Recap

  • One h1 per page, with h2 and h3 nested in order; headings describe sections.
  • A p is a thought that wraps naturally; br is only for genuine line breaks.
  • strong and em carry meaning, and block elements never go inside a paragraph.

Next, you will connect pages with links, including the difference between relative and absolute paths.

Can I use h1 more than once?
HTML permits it, but one h1 per page is clearer for readers and tools. Use section headings for the rest.
Should I use b and i instead of strong and em?
Use `b` and `i` only when the visual difference is the whole point and there is no importance or stress, such as a product name in a foreign language. Otherwise `strong` and `em` describe the meaning.

Full syllabus

Progress is saved in this browser only. No account, no email.

Admin

About the author

Admin

Instructor and technical writer at tutorials.in

Writes beginner lessons for tutorials.in. Each lesson is checked against the language or tool documentation, and examples are run before publishing.

Reviewed by the editorial team before publishing. Last updated November 16, 2026.