Empty Tags vs Content Tags

Some tags like div, span and p need content.

With HTML5, empty tags don't need to be closed.

The following examples are equivalent:

<!-- Auto-closing tag. -->
<input type="text"/>

<!-- Implicit auto-closing tag. -->
<input type="text">

Closing empty tags might seem cleaner but it is better to leave them open.

Last updated