+ 12

In HTML <br> and <br/> are same.

In some codes I noticed that <br> tag is used to create single line break but in some codes <br/> is used to create single line break, is there any diiffernce in them or they are similar tags used for same purpose.

15th Nov 2021, 5:15 PM
Sujal - avatar
4 Answers
+ 5
This is same tag, but in html5 we dont need to add "/" on some tags what dont have closening tag. Best is to check here for each tag, select your tag and see how thay use tag in code https://www.w3schools.com/tags/default.asp Here is more about this topic https://www.codecademy.com/forum_questions/52eb7f6a80ff334f3300085f Tags like <br> and <hr> dont need "/" for sure
15th Nov 2021, 6:45 PM
PanicS - avatar
+ 11
PanicS thanks 😃
16th Nov 2021, 1:22 AM
Sujal - avatar
+ 4
<br> tag doesnt require a closing tag ...
16th Nov 2021, 10:57 AM
Simbarashe Deke
Simbarashe Deke - avatar
+ 1
Yes they both are same but i think it's good practice to use <br> for line break instead of <br/>
16th Nov 2022, 12:22 PM
Nitin Vishvakarma
Nitin Vishvakarma - avatar