+ 1
Is this html 3?
Horizontal line tag is usually <hr/> but I wonder why this one too works <hr></hr>. Was it à tag in earlier html versions ?
3 Respostas
+ 11
You must properly close the <hr/> tag in XHTML though it doesn't have an ending tag in HTML (<hr>). Hence, both of the ways work as the same.
+ 5
Horizontal ruler tag is a tag without closing tag pair, it does not support content within it, then XHTML standard was invented , which strictly defines that no tag was allowed to be orphaned (unpaired), hence the <hr /> is a workaround to fit XHTML requirement, other unpaired tags were also treated the same. Your way of writing <hr></hr> works because browsers were "taught" of possible incorrectly written tags, they simply ignore such events, take it as just <hr>, and ignore the </hr> because it is not recognized.
0
Really explanatory