+ 1
When I used <br>code were working but when I used <br /> it were working also why ? Is there no difference between <br> &<br/>
6 Antworten
+ 7
Hello, Akash Vishwakarma !
The fact is that when writing <br/> developers in use XHTML, not HTML. According to the XHTML 1.0 specification, all tags that do not have a closing part must be written in the form:
<tag [parameters] />
The same rule works in XML documents. In XML, all tags must be closed. In case the element does not have a closing tag (for example, <img> or <br>), you need to add a slash at the end of the tag: <img/> and <br/>. In some browsers designed for XML, the absence of a space before the slash may lead to unreadability of the tag.
However, in 99.9% of cases there will be no difference. HTML interpreters usually just ignore the extra "/".
+ 4
There is no difference at all.
You can skip / as per latest addition.
Hope this helps ☺️☺️.
0
thanks
0
For further light reading:
https://stackoverflow.com/questions/1946426/html-5-is-it-br-br-or-br
0
thank you very much
0
No problem. ☺👍