<br>
A line break at the point it’s inserted, without starting a new paragraph.
- Display
- inline
- Closing tag
- None, void element
- Permitted content
- None, the element is void
Example
#<p>
Lost semicolon,<br>
the whole console turns red,<br>
coffee's gone cold now.
</p>Definition and usage
#The <br> element moves the following text to a new line. It’s a void element, with no closing tag. Use it where the line break is part of the content itself: in poetry, in a mailing address, or in a caption that must break at a specific spot.
Don’t use <br> to create spacing. A row of several <br><br> tags is a common beginner mistake: the size of the gap then depends on the font size and is hard to change, and for a screen reader the text is still one block with no structure. Set spacing in CSS, and put separate thoughts in separate <p> paragraphs.
Both <br> and <br /> are valid in HTML, and the slash has no effect at all. </br>, however, is an error, though browsers forgivingly treat it like <br>.
Syntax
#First line<br>
Second lineAttributes
#This element has no attributes of its own. It supports the global attributes, such as class, id and hidden.
More examples
#<p>
Byte Coding School<br>
123 Keyboard Ave<br>
Austin, TX 78701
</p>Browser support
#Widely available
Works in all modern browsers, phones included. You can use it without worry.
- Chrome
- Edge
- Firefox
- Safari
Good practices
#- Set spacing between blocks of text in CSS (
margin), not with repeated<br>tags. - If you’re starting a new thought, close the paragraph and open a new
<p>instead of breaking the line. - For long words that should only break when necessary, use
<wbr>instead of<br>.
Related entries
#- <p>A paragraph of text.
- <wbr>A spot where the browser may break a long word or string of characters when the line runs out of room.
- <pre>Preformatted text: it preserves spaces, tabs, and line breaks exactly as they appear in the code.
- <hr>A thematic break in content, for example a scene change in a story or a shift to a different topic.
Spotted a mistake or missing an example? Write to us.