- 1
Which tag has no ending tag?
3 Answers
+ 18
HTML course described these tags.
+ 4
@Elizabeth:
It seems to me than the ending slash is technically invalid in Html5 (but tolerated by browsers according to Html specifications permissivity which expect than html documents are parsed and displayed "as well as they can" and do auto-correcting invalid codes), optional in Html4 (purpose was to migrate towards XHTML, wich was abandonned since Html5), and obviously required in XHTML ^^ (but I'm too much lazy to go searching again for references ;P)
+ 2
Here's a complete list of self-closing tags of HTML5. These are called âvoid-elementsâ .
<area />
<base />
<br />
<col />
<command />
<embed />
<hr />
<img />
<input />
<keygen />
<link />
<meta />
<param />
<source />
<track />
<wbr />
The space before the slash is optional.
HTML5: the slash is optional.HTML4: the slash is technically invalid. However, it's accepted by W3C's HTML validator.XHTML: The slash is REQUIRED.
but i recommend to always add the slash. Because, it provides a visual clue of non-closing tags. It's also convenient if you write simple script to check your HTML.