What is different between <br/> and <br>? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is different between <br/> and <br>?

20th Sep 2016, 11:00 AM
Suhaila Zaid
3 Answers
+ 4
<br> is used in HTML and <br /> is used in XHTML. HTML and XHTML use a different syntax. IE6 for example does not support XHTML. Regarding XML rules all elements should have a closing element and here should be used the XML empty element syntax: a space between the element and the closing-slash. You can read more about that here: http://reference.sitepoint.com/html/html-xhtml-syntax /*Happy Coding*/
20th Sep 2016, 1:52 PM
# ff00ff
# ff00ff - avatar
+ 1
Towards the above post, HTML and XHTML are the same thing, for the most part. XHTML is a more strict version of HTML where all tags must be up-to-date, closed, positioned and written (caps) properly. <br /> is the proper version of <br>. Both will work in HTML but only the first one will work in XHTML.
12th Nov 2016, 1:02 AM
Ben - avatar
Thank u
15th Nov 2017, 12:47 PM
Suhaila Zaid