HTML Reference ยท Inline Text
The <br> element
Reference for the HTML <br> element: inserting a line break inside text, when it is the right choice, common mistakes, accessibility and technical details.
The <br> element produces a line break. The text after it starts on a new line, inside the same paragraph or block. It is a void element: it has no content and no end tag.
Use it where the line break is part of the content itself, as in a postal address, the lines of a poem or song, or a signature. Don't use it to create space between blocks.
<p>14 Harbour Road<br>Galway<br>Ireland</p>
Try it
Attributes
This element has no attributes of its own. It accepts the global attributes. The old clear attribute is obsolete; use the CSS clear property instead.
Usage notes
- Not for spacing. Several
<br>in a row to push content down is fragile and confusing for screen reader users, who may hear "blank" repeatedly. Use separate<p>elements and CSSmargininstead. - Not for separating list items. Lines that form a list belong in
<ul>or<ol>. - Writing it.
<br>and<br />are both valid HTML. Never write</br>; there is no end tag. - Breaks for layout. If a break only makes sense at certain screen widths, control it with CSS instead. For a place where a long word may break, use
<wbr>. - Preformatted text. Inside
<pre>you can use real newlines instead of<br>.
Technical summary
| Content categories | Flow content, phrasing content |
| Permitted content | Nothing (void element) |
| Tag omission | Must have a start tag and must not have an end tag |
| Permitted parents | Any element that accepts phrasing content |
| Implicit ARIA role | No corresponding role |
| DOM interface | HTMLBRElement |
| Default display | Forces a line break; it has no box of its own |
Browser support
Supported in every browser.
Related
<wbr>โ an optional line-break opportunity<p>โ a paragraph<pre>โ preformatted text that keeps line breaks- Lessons: Headings and Paragraphs, Block and Inline Elements