HTML5

Where to use <br>, <br/> and <br /> ?

The <br> element inserts a single line break. A frequent question is whether you should write <br>, <br/>, or <br />. The answer: all three are valid in HTML5 and render exactly the same line break. The difference is purely a matter of syntax style.


All Three Are Valid

<br> is a void (empty) element — it has no closing tag and no content. In HTML5 you can write it in three equivalent ways, all of which the browser renders identically:

Three equivalent ways to write a line break
Line one<br>Line two
Line one<br/>Line two
Line one<br />Line two

Which Style Should You Use?

SyntaxStyleWhen to use
<br>HTML5 stylePreferred in plain HTML5 documents.
<br/>XHTML self-closingRequired in XHTML/XML; also common in JSX-like syntaxes.
<br />XHTML self-closing (with space)Older XHTML convention; the space is optional.

Use <br> for Line Breaks, Not Spacing

The <br> tag is meant only for line breaks that are part of the content — for example, lines of a poem or a postal address. Do NOT use multiple <br> tags to create vertical space between blocks; use CSS margins or padding instead.

Good use: address lines
<p>
  221B Baker Street<br>
  London<br>
  England
</p>
⚠️

Avoid stacking <br><br><br> to push content down the page. That is a presentation concern — use CSS (margin, padding) instead.

Ready to use your HTML skills?

Find web development internships and fresher jobs across India.

Browse Web Dev Internships