<br>, <br />, and <br/> | The Guide to the break Tag in HTML

The HTML <br /> tag creates the “br” (break) element, which represents a line break in an HTML document.

Louis Klimek
Louis Klimek

Should I use <br>, <br />, or <br/> ?

According to the XHTML guidelines you should either use <br/> or <br></br> since XML doesn't allow leaving tags open.

And following the HTML 5 Reference Draft, it tells you that for normal HTML <br> is self-closing and expected, but that a closing slash is allowed, but also that <br></br> is not valid and will be interpreted as two line breaks.

Conclusion

You should definitely use <br /> to stay backwards-compatible with older browsers and choose yourself between <br/> or <br />, whichever pleases your aesthetics since dev.w3.org tells you that one or more space characters are optional.

   

How do I use <br /> ?

The <br /> Tag can be easily used by just placing it at whatever position you want your line break to be. See following code example:

<p>
First Line<br />
Second Line<br />
Third Line
Fourth Line
</p>
                        

Result:

First Line
Second Line
Third Line Fourth Line

See how the First and second line are separate because an <br /> is present, but the third and fourth line are actually on the same line.

   

Should I even use <br /> tags or is it bad practice?

Even though the <br /> tag is mostly used for creating line breaks, the HTML5 specification allows it to be styled in such a way that the browser does not render line breaks.

[...] line breaks are usually represented in visual media by physically moving subsequent text to a new line, a style sheet or user agent would be equally justified in causing line breaks to be rendered in a different manner, for instance as green dots, or as extra spacing.

-HTML5 specification

But if you want to use it to split paragraphs you are probably better off by creation two <p> Tags like this:

<p>First paragraph</p>
<p>Second paragraph</p>
                        

Because you can then easily adjust the spaces between paragraphs through CSS. Other than that, there is not anything speaking against line breaks, since the <br /> Tag is not deprecated in any way.

Conclusion

If you want to use the <br /> Tag as a styling element you should think twice and rather use two <p> blocks and style them using CSS.

But if you want to use it  as a visual separator which shows some dots or similar it is fine to use the <br /> Tag.