</br> AND <br/> | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

</br> AND <br/>

what is the difference between these two brothers

3rd Jul 2017, 8:00 AM
Abroz Khan
Abroz Khan - avatar
7 Answers
+ 2
and I tell you, it doesn't exist in the W3C standards (World Wide Web Consortium)
3rd Jul 2017, 8:10 AM
Marco Macdon
Marco Macdon - avatar
+ 4
</br> is invalid form in all cases <br/> is the XHtml form, and was supported by Html4 for compatibility with XHtml purpose <br> is the only actual (Html5 specifications) valid form (as XHtml was now abandonned, Html5 doesnt more support it) Anyway, all three forms are working most of the time in browsers, because Html specifications tell that browsers are expected to keep Html permissive, and try to render better as possible whole content of a web document... So they are all implemented a bunch of auto-corrections in case of more or less invalid Html (so </br> or <br/> is easily explicitly understandable and corrected as <br> -- but in some cases, you cannot predict if all browsers will correct invalid Html in same ways). However, search engines are not mandatory to accept malformed/invalid web documents, and will downrate your site/page in such case :P
3rd Jul 2017, 8:28 AM
visph
visph - avatar
+ 2
ty
3rd Jul 2017, 8:13 AM
Abroz Khan
Abroz Khan - avatar
+ 1
<br/> is the right way to do it.. the other is not. It's wrong and doesn't exist. It's either <br> or <br/>
3rd Jul 2017, 8:05 AM
Marco Macdon
Marco Macdon - avatar
+ 1
Simply <br> is sufficient. The other forms are there for compatibility with XHTML; to make it possible to write the same code as XHTML, and have it also work as HTML. Some systems that generate HTML may be based on XML generators, and thus do not have the ability to output just a bare <br> tag; if you're using such a system, it's fine to use <br/>, it's just not necessary if you don't need to do it. Very few people actually use XHTML, however. You need to serve your content as application/xhtml+xml for it to be interpreted as XHTML, and that will not work in old versions of IE - it will also mean that any small error you make will prevent your page from being displayed in browsers that do support XHTML. So, most of what looks like XHTML on the web is actually being served, and interpreted, as HTML. See Serving XHTML as text/html Considered Harmful for some more information. source:stackoverflow.com
3rd Jul 2017, 8:06 AM
Calden Rodrigues
Calden Rodrigues - avatar
+ 1
you're welcome bro
3rd Jul 2017, 8:14 AM
Marco Macdon
Marco Macdon - avatar
0
brother but I used </br> is existing
3rd Jul 2017, 8:06 AM
Abroz Khan
Abroz Khan - avatar