Skip to content Skip to sidebar Skip to footer

What Tags In Html5 Are Acknowledged Of Being Self-closing?

Here is the list that I got from complete list of HTML5 self-closing tags
&l

Solution 1:

They are not self-closing elements. They are void elements.

Void elements must not have end-tags. In HTML5, <br> and <br /> mean the same thing: they are both start tags! It just so happens that no end tag is required for these elements. There is no concept of a self-closing tag in HTML5.

So you might as well write these without the slash, although I personally find it more readable if the slash is present.

Solution 2:

Seems like your list is complete according to W3C list (but as Quentin point out, HTML5 draft is still subject to change)

Besides, according to various sources the following obsolete or non-standard tags are void:

basefont, bgsound, frame, isindex

Solution 3:

The HTML Standard calls these void elements. Here’s the current list:

  • area
  • base
  • br
  • col
  • embed
  • hr
  • img
  • input
  • keygen
  • link
  • menuitem
  • meta
  • param
  • source
  • track
  • wbr

However, based on the context within the HTML document, there may be more “self-closing” elements. To get the list of those, open the HTML Standard and search (Ctrl+F or Cmd+F) for Acknowledge the token's self-closing flag. For example, math and svg can be self-closing. script can be self-closing in an SVG context.

Post a Comment for "What Tags In Html5 Are Acknowledged Of Being Self-closing?"