+ 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??

11th Jul 2020, 3:42 PM
Ansh The ALLEN student
Ansh The ALLEN student - avatar
4 Réponses
+ 5
Just remember both of them works https://code.sololearn.com/WndUvsoRRFe9/?ref=app
11th Jul 2020, 3:49 PM
Nilesh
Nilesh - avatar
+ 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.
11th Jul 2020, 3:51 PM
Gordon
Gordon - avatar
+ 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
11th Jul 2020, 3:57 PM
Zachiah sawyer
Zachiah sawyer - avatar