+ 2
<br> or <br /> ?
what is the difference btw those? Is the spaces needed after br to put slash(br /) and where to use <br> and where to use <br />?
4 ответов
+ 4
<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 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
https://www.sololearn.com/Discuss/507808/?ref=app
+ 2
@sami thanq
+ 1
no difference..they are same.. these are the empty tags.. they don't need to close anymore in html5
+ 1
thanq @visph I got a clear understand