What is the correct way of using <br>, <br/>, or <br /> in HTML?

HTMLWeb DevelopmentFront End Technology

In HTML, the <br> tag is used for line break. It is an empty tag i.e. no need to add an end tag. Writing <br> tag is perfectly fine.

Let’s see the usage of other br tags i.e. <br/> or <br />,

In HTML, use <br> tag.

In XHTML, the valid way is to use <br/> or <br></br> as mentioned in the XHTML guidelines.

According to w3 guidelines, a space should be included before the trailing / and > of empty elements, for example, <br />. These guidelines are for XHTML documents to render on existing HTML user agents.

You can try to run the following code to learn the perfect usage of <br> tag


Live Demo

<!DOCTYPE html>
      <title>HTML br Tag</title>
      <p>This is before the line break<br>
         and this after the line break.
Published on 07-Feb-2018 12:51:04