W3docs

HTML <br> Tag

The HTML <br> tag is used for a line break. Read information about the usage of the <br> tag, and know how to style it with CSS. Also, see examples.

Definition

The HTML <br> tag defines a line break. Unlike the <p> tag, which creates a paragraph break, the <br> tag simply moves the following text to the next line without adding extra vertical space.

br example

Syntax

The <br> tag is a void element in HTML5, which means it does not require a closing tag. However, in XHTML, it must be self-closed (<br />).

Example of the HTML <br> tag:

br tag example

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
  </head>
  <body>
    <h1>Example of the &lt;br&gt; tag usage.</h1>
    <p> Inside the paragraph, we can put the tag &lt;br /&gt;, <br /> to transfer a part of the text to another line if necessary.</p>
  </body>
</html>

Usage

The <br> tag is used to enter line breaks. It is useful for writing addresses, poems or song lyrics.

Danger

Do not use <br> tag to separate paragraphs. It is very problematic to use <br> tag to separate the paragraph for the people who navigate through the screen reading technology. Use <p> elements and CSS margin property to control spacing.

Example of the HTML <br> tag for entering line breaks:

HTML br Tag

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
  </head>
  <body>
    <h1>Example of the &lt;br&gt; tag usage</h1>
    <blockquote>
      But I'm not the only one<br />
      I hope some day you'll join us<br />
      And the world will live as one.<br />
    </blockquote>
    <cite>John Lennon "imagine"</cite>
  </body>
</html>

Attributes

AttributeValueDescription
clearallClears floats from both sides. Not used in HTML5.
clearleftClears floats from the left side. Not used in HTML5.
clearrightClears floats from the right side. Not used in HTML5.
clearnoneCancels the effect of the clear attribute. Not used in HTML5.

The <br> tag supports the Global Attributes and the Event Attributes.

Practice

Practice

What is the purpose of the HTML <br> tag and how is it used?