Which is the correct way to use the <br> tag for a line break in HTML?

Should we use <br> or </br> to create a line break? And what about the <hr> tag, should it be written as <hr /> or just <hr>?

I tested both <br> and </br>, and they seem to render the same. However, some online sources suggest that </br> is better.

I’m a bit confused, especially regarding self-closing tags like <hr />. Is spacing required in <hr />, or is <hr/> also acceptable?

What’s the correct and modern way to use the br tag and similar HTML elements?

Good question! The correct way to insert a line break in HTML is just <br>.

You don’t need </br>, in fact, that’s invalid HTML. <br> is a void element, meaning it doesn’t have a closing tag. Same with <hr>.

So the modern, valid way is simply <br> and <hr>.