Why should I use this freaking / in br and hr tags? it works without it too😒 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why should I use this freaking / in br and hr tags? it works without it too😒

1st Oct 2020, 1:22 PM
Anastasiia Niekrasova
Anastasiia Niekrasova - avatar
4 Answers
+ 3
the older browsers cant process without the /
1st Oct 2020, 1:25 PM
Ali Zain
Ali Zain - avatar
+ 1
Yes. It works. For empty tags, / is optional. But According to the standards and guidelines, better to use.. to support in any browsers. Helps in xml parsing.. You must use it in xhtml. Else it show error there..
1st Oct 2020, 1:25 PM
Jayakrishna 🇮🇳
0
Thanks Ali Zain and Jayakrishna🇮🇳 !!❤️
1st Oct 2020, 1:44 PM
Anastasiia Niekrasova
Anastasiia Niekrasova - avatar
- 1
It is good practice to use <br /> or <hr /> When you will learn javascript frameworks like reactjs. You have to use <br /> and <hr /> instead of <br> and <hr>
1st Oct 2020, 2:32 PM
🇮🇳Vivek🇮🇳
🇮🇳Vivek🇮🇳 - avatar