HTML5 <br> Tag

The HTML <br> tag is used to create a line break in the text. It is useful when you are writing a poem or an address and the division of lines is significant.

No content is permitted inside the <br> tag as it is a void element. The start tag is mandatory for this element but there must be no closing tag. In XHTML documents, you should write this element as <br />. The parent of the <br> tag can be any element that accepts phrasing content.

You should not use the <br> element to increase the gap or space between lines of text. This should be done by using the CSS margin property or the <p> element.

Here is an example of using this tag:

<p>Twinkle, twinkle, little star,<br> 
  How I wonder what you are!<br> 
  Up above the world so high,<br> 
  Like a diamond in the sky.</p>

Attributes

This element only accepts global attributes.

Examples

See the Pen HTML br Tag by Tutorialio (@tutorialio) on CodePen.

Further Reading

  1. Read more about the HTML <br> element on MDN.
  2. You can also read the HTML <br> tag reference on W3C.

Reader Comments

1. You can register or login to post a comment. Asking readers to register improves the quality of discussion.

2. As a registered user, you will also get to access features like choosing between a light and dark theme or anything else that we might implement in future.

Follow Us For Updates

FacebookTwitterGoogle+
Go To Top