why <br/> tag has no end tag? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

why <br/> tag has no end tag?

1st Jul 2016, 1:10 PM
Caraline Raj
Caraline Raj - avatar
4 Réponses
+ 8
<br> (correct HTML5) and similar tags like <hr> are called 'void elements'. Apparently, they don't need a closing tag because they don't have any content. If there was content like in <h1>A Heading</h1> the closing tag is needed to tell browsers and screenreaders (for blind people) the heading ends right here after 'Heading'.
1st Jul 2016, 1:45 PM
ZinC
ZinC - avatar
0
does that mean its a single action rather than content?
5th Jul 2016, 1:43 AM
jjthejetplane
0
because it is void tag and not require closing tag
13th Jul 2016, 10:05 AM
Aryant
Aryant - avatar
- 1
because it's unary tag
2nd Jul 2016, 7:31 AM
Jiten