Back to HTML Notes
Topic #93

Line Break (br)

Learn how to use the <br> element for forced line breaks and understand when to choose it over paragraphs.

What it is

The <br> (line break) element inserts a single newline character in text, forcing content to continue on the next line without creating a new block-level container. It is an empty element, meaning it has no closing tag. Think of it as pressing "Enter" once in a word processor: it moves the cursor down but does not start a new paragraph with extra spacing.

Related terms include whitespace collapsing (where HTML ignores multiple spaces/newlines in source code) and block-level elements like <p>, which create distinct structural sections.

Why it matters

  • Address formatting: Essential for mailing addresses where each line must be distinct but part of one logical unit.
  • Poetry and lyrics: Preserves specific visual line structures that standard paragraphs would disrupt.
  • Form labels: Can separate a label from its input field if CSS styling is minimal or unavailable.
  • Accessibility clarity: Using <br> correctly prevents screen readers from announcing unnecessary paragraph pauses.

Syntax or steps

To insert a line break, place the <br> tag exactly where you want the text to wrap. No attributes are required. In HTML5, the self-closing slash (<br />) is optional but valid; modern best practice favors <br>.

Example

<p>
  John Doe
123 Main Street
Springfield, IL 62704 </p>

This example wraps address lines inside a single paragraph. The <br> tags force each component (name, street, city/state/zip) onto its own line while keeping them grouped semantically as one address block.

Common mistakes

  • Using <br> for layout: Never use multiple <br> tags to create vertical space between sections. Use CSS margins instead.
  • Replacing paragraphs: Do not use <br><br> to simulate paragraph spacing. This harms accessibility and SEO. Always use <p> for distinct thoughts.
  • Closing tags: Attempting to write </br> is invalid. The <br> element is void and cannot have children or a closing tag.
  • Inside headings: Avoid using <br> within <h1>-<h6> tags unless strictly necessary for visual design, as it can confuse document outline tools.

When to use it

Choose <br> only when line breaks are part of the content’s meaning (like poetry). Choose <p> for normal prose separation.

ScenarioUse ElementReason
New idea or topic<p>Creates semantic structure and default spacing.
Mailing address<br>Lines are visually distinct but logically one unit.
Poetry stanza<br>Preserves exact line breaks intended by author.
Vertical spacingCSS MarginSeparation should be presentational, not structural.

Practice

Guided Exercise: Write HTML for a poem excerpt where each line ends with a break, but all lines belong to one stanza.

Challenge: Refactor this incorrect code: <p>Hello World<br><br>Goodbye World</p>. Why is this bad? What should replace the double breaks?

Hint: The challenge requires splitting into two separate <p> elements.

Quick check

Question: Should you use <br> to add space between two unrelated paragraphs?

Answer: No. Use separate <p> elements and control spacing with CSS margins.

Summary

The <br> element is a precise tool for content-specific line breaks, such as addresses or poetry, rather than a layout mechanism. Reserve <p> for semantic paragraph separation and rely on CSS for visual spacing to maintain clean, accessible markup.

Want to go beyond the notes?

Join Coding Now Tech Institute's HTML course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

Line Break (br) – FAQs

Quick answers about learning Line Break (br) in HTML.

This free note from Coding Now Tech Institute explains Line Break (br) in HTML — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every HTML topic on Coding Now Tech Institute, including Line Break (br), is 100% free with no signup required.
With focused practice, most students grasp Line Break (br) in 1–3 days from these notes; pairing it with Coding Now Tech Institute's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the Coding Now Tech Institute Community (/community) — expert instructors answer within 24 hours.
Call NowEnroll Now