<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
On this page

Example

#
HTML
<p>
  Lost semicolon,<br>
  the whole console turns red,<br>
  coffee's gone cold now.
</p>
Preview

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

#
Syntax
First line<br>
Second line

Attributes

#

This element has no attributes of its own. It supports the global attributes, such as class, id and hidden.

More examples

#
Mailing address
HTML
<p>
  Byte Coding School<br>
  123 Keyboard Ave<br>
  Austin, TX 78701
</p>
Preview

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

#

Spotted a mistake or missing an example? Write to us.