HTML: What's the correct form of BR?

Adam Halasz picture Adam Halasz · Nov 26, 2010 · Viewed 28.6k times · Source

How is correct to write the br tag in html?

<br />

or

<br>

or anything else? :))

Answer

casablanca picture casablanca · Nov 26, 2010

It depends on the doctype you're using. In the original versions of HTML (up to HTML4), only <br> is correct. In XHTML (which is based on XML), only <br /> is correct. In HTML5, both are allowed although <br> is preferred.