Is </br> valid even though it works? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Is </br> valid even though it works?

I've spent the past maybe 5 lazy minutes trying to find an answer to the difference between <br> and </br> because I just noticed while doing my CTI work that I used </br> instead of <br> and it still functioned perfectly. The text says to use <br> but since </br> worked the same I figured I'd investigate the matter. The main question I have is, is </br> valid code, and is it acceptably interchangeable with <br>? Or is it just something overlooked but frowned upon?

18th Sep 2019, 12:20 AM
Lonnie Wright
1 Answer
+ 3
I don't think so. Only know of <br> and <br/> but then, HTML5 interpreter does not throw errors.
18th Sep 2019, 1:35 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar