Skip to content
Learn Netverks

Lesson

Step 7/58 12% through track

paragraphs

Paragraphs and line breaks

Last reviewed Jun 1, 2026 Content v20260601
Track mode
iframe_html
Means
HTML preview sandbox
Reading
~3 min
Level
advanced

This lesson

This lesson teaches Paragraphs and line breaks—the ideas, syntax, and habits you need before moving on in HTML.

Without a solid grasp of Paragraphs and line breaks, you will repeat mistakes in HTML exercises and on real pages or scripts.

You will apply Paragraphs and line breaks in contexts like: Websites, hybrid apps, email templates, design systems, and CMS-driven content.

Read the lesson, edit HTML/CSS in the playground, press Run to preview, then answer the lesson MCQs. Also use the HTML reference desk when you need tag or attribute lookup.

When intermediate lessons feel comfortable and you are ready for production-style trade-offs.

The <p> element represents a paragraph of prose. Browsers render paragraphs as block-level boxes with default vertical margins—exact spacing belongs to CSS, not additional empty paragraphs.

When to use p

  • Continuous textual explanations, intros, disclaimers, narrative body copy.
  • Each distinct prose block gets its own p rather than stuffing unrelated sentences into one giant paragraph unless editorial style demands it.

Line breaks with br

<br> inserts a soft line break inside the same paragraph—appropriate for poetry lines, formatted addresses, or legal disclaimers where breaks carry meaning. It is not a substitute for paragraph spacing or vertical rhythm.

Example — paragraphs vs line breaks vs rule

<p>First prose block.</p>
<p>Warehouse address:<br>
123 Freight Ave<br>
Portland, OR</p>
<p>Second topic resumes here.</p>
<hr>
<p>After a thematic shift…</p>

Rendered output

First prose block.

Warehouse address:
123 Freight Ave
Portland, OR

Second topic resumes here.


After a thematic shift…

Thematic breaks with hr

<hr> represents a thematic shift between paragraphs—use when the break carries semantic meaning. Decorative separators belong in CSS backgrounds or borders, not gratuitous rules.

Spacing anti-patterns

  • Stacking multiple br elements to emulate margins.
  • Empty <p></p> or paragraphs containing only   for vertical gaps.
  • Putting block-level elements inside p—the parser will implicitly close the paragraph when it sees them.

Preformatted text

Use <pre> when whitespace fidelity matters (ASCII art, shell snippets paired with code). Ordinary paragraphs should rely on normal flow and CSS for wrapping.

What developers mistakenly ship

  • Dummy paragraphs (<p>&nbsp;</p>) purely for spacing—maintainers delete them unknowingly and layout shifts; spacing belongs in CSS on real elements.
  • Giant unbroken strings without wrapping hints—fine in pre; in normal text they overflow on mobile unless CSS handles overflow.
  • Raw user HTML pasted into prose without escaping—stored XSS starts here; templating frameworks must encode by default.

When to reconsider br vs a new paragraph

If two lines form separate thoughts, readers benefit from paragraph separation (p) and consistent vertical rhythm (margin in CSS). Reserve br for addresses, poems, legal lines, or CSV-like rows—not general layout.

Important interview questions and answers

  1. Q: What is the purpose of ``?
    A: It forces standards mode so browsers use modern layout/parsing behavior instead of legacy quirks mode.
  2. Q: Why is semantic HTML important in interviews and production?
    A: It improves accessibility, SEO, maintainability, and reduces ARIA/JS work by using native element behavior.
  3. Q: What is the difference between `head` and `body`?
    A: `head` stores metadata/resources for the document, while `body` contains user-visible content.

Tip: Use <p> for paragraphs—not double <br> for spacing.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs in your browser in a sandboxed frame. Backend runners appear when this track’s profile allows them.

Check yourself

Multiple choice — immediate feedback.

Community stories on this track

Learner essays linked to HTML — not official lesson content.

Browse all stories

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • What confused you about this lesson?
  • How would you explain this to a teammate in 30 seconds?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump