+ 1
Is it <br> or <br />?
According to SoloLearn it is <br /> but according to other sources its is <br>!! So what reality should I come up with??
4 ответов
+ 5
Just remember both of them works
https://code.sololearn.com/WndUvsoRRFe9/?ref=app
+ 3
In old XML,
a tag must be closed.
so opening tag must be paired with ending tag,
or it has no child, it can be self closing (with a /)
e. g.
<link />
<img />
Nowadays, HTML no longer needs follow XML, so single opening tag <br> is ok too now.
+ 2
Gordon is correct, but another thing to note is that using <br /> is a good habit to get into, because sometimes you have to use it. Like in jsx