Live Preview
Text with a line break:
This text is on one line.
This text is on the next line.

By the end of this tutorial, you’ll know when to use line breaks and when CSS or paragraphs are the better choice.
Write valid self-closing <br> elements in HTML5.
Understand how br moves text to the next line within the same block.
Choose line breaks for addresses and poetry; use p for distinct paragraphs.
Format postal lines inside the address element with br.
Use margin and separate p tags instead of stacked br tags.
Apply accessibility best practices for meaningful line breaks.
<br> Tag?The br element (<br>) produces a line break in text. Unlike <p>, it does not create a new paragraph block—it only breaks to the next line within the current flow of content.
<br> is a void (self-closing) element. Write <br> or <br /> in XHTML-style HTML5. There is no </br> closing tag.
Use br when line breaks are part of the content meaning—addresses, poetry, song lyrics, or signature lines. Avoid stacking multiple br tags for page layout spacing.
Insert <br> where you want the line to break. Both forms are valid in HTML5:
<!-- Basic line break -->
This is some text.<br>
And this is on a new line.br is a void element—no closing tag required.<br /> is also valid in HTML5.br tags for vertical spacing—use CSS margin instead.<p>
Line one.<br />
Line two.
</p>| Use Case | Code Snippet | Result |
|---|---|---|
| Single break | Line one.<br>Line two. | Line one. |
| Inside paragraph | <p>...<br>...</p> | First line. |
| Address lines | <address>...<br>...</address> | Postal formatting |
| Paragraph spacing | <p>...</p><p>...</p> | Prefer over stacked br |
| Layout spacing | p { margin: 1rem 0; } | CSS, not br |
| Void element | <br> or <br /> | No closing tag |
Choose the right element based on whether you need a line break or a new paragraph block:
| Feature | <br> | <p> |
|---|---|---|
| Purpose | Line break within one block | New paragraph block |
| Spacing | No paragraph margin added | Default top/bottom margin |
| Best for | Addresses, poetry, lyrics | Distinct prose paragraphs |
| Element type | Void (self-closing) | Block with opening/closing tags |
<!-- Line break within one block -->
<p>Line one.<br>Line two.</p>
<!-- Separate paragraphs -->
<p>First paragraph.</p>
<p>Second paragraph.</p>The <br> tag has no tag-specific attributes in HTML5. Use global attributes only:
class / id GlobalHook for CSS styling. Rarely needed on br, but valid for targeted styling.
<br class="spacer">clear ObsoleteDeprecated attribute for clearing floated images. Do not use—apply CSS clear instead.
/* Use CSS clear instead */Element type VoidSelf-closing element with no content and no closing tag. Cannot contain child elements.
<br> or <br />Allowed in PhrasingInside paragraphs, address, headings (when appropriate), and other phrasing content contexts.
<p>, <address>, text flowThe clear attribute is obsolete in HTML5. Use CSS clear property on block elements for float clearing.
Real-world line break patterns with copy-ready code, live previews, and hands-on practice.
Text with a line break:
This text is on one line.
This text is on the next line.
The most common use: one <br> to move text to the next line.
<p>
This text is on one line.<br>
This text is on the next line.
</p>Use <br> when line breaks are part of the content itself—not for general page layout spacing.
Stacking <br> tags creates extra blank lines. Avoid this for layout—use CSS margin instead.
<p>
This is on the first line.<br><br>
This is on the third line after two breaks.
</p>A proper use case: line breaks inside an <address> element for postal formatting.
<address>
CodeToFun HQ<br>
123 Web Street<br>
Chennai, Tamil Nadu 600001<br>
India
</address>For spacing between blocks of text, use separate <p> elements with CSS margin instead of multiple <br> tags.
<style>
p { margin: 0 0 1rem; }
</style>
<p>This is the first paragraph.</p>
<p>This is a separate paragraph with CSS spacing.</p>Prefer CSS margin on block elements instead of stacked line breaks for layout spacing:
<br> Content line breaksp { margin } Paragraph spacinggap / padding Layout spacingbr + br Avoid for layout/* Better than stacked br tags */
p {
margin: 0 0 1rem;
}
/* Last paragraph: no bottom margin */
p:last-child {
margin-bottom: 0;
}CSS-spaced paragraphs (no br)
First paragraph with margin spacing.
Second paragraph—clean and maintainable.
Line breaks affect how assistive technologies read content:
br is appropriate when line position carries meaning.address, not plain divs with br.Place the void element where a line break should occur within content.
Text after br continues on the next line in the same block.
Unlike p, br does not add paragraph spacing or a new block box.
Use br sparingly for meaningful breaks. Use p and CSS for layout.
The <br> element is supported in all browsers and has universal compatibility.
From legacy Internet Explorer to the latest Chromium builds — the br element is one of the most universally supported HTML tags.
Bottom line: Use <br> with confidence for meaningful line breaks. Supported in every production environment today.
The <br> tag is a simple but important element for line breaks within text. Use it for addresses, poetry, and lyrics where line position matters.
For paragraph spacing and page layout, prefer <p> and CSS over stacked br tags.
br for addresses and poetryaddress elementp tags for separate paragraphsmargin for layout spacingbr tags for vertical spacingbr instead of p for paragraphsclear attributebr for page layout structure<br>Bookmark these before you ship — they’ll keep your line breaks meaningful and accessible.
<br> inserts a line break within text without starting a new paragraph.
Self-closing with no closing tag—write <br> or <br />.
br = same block; p = new paragraph with spacing.
Ideal for postal lines, poetry, and lyrics where line position matters.
Use CasePrefer margin on block elements over stacked br tags.
Supported in every browser including IE. No polyfills required.
Compatibilitybr is a void element. Write <br> or <br />—no closing tag needed.br breaks a line within one block. p starts a new paragraph with its own spacing.margin or separate p elements. Stacked br tags are hard to maintain and hurt accessibility.Try single and multiple br examples in the interactive editor.
6 people found this page helpful