Jacob Paris
← Back to all content

Understanding HTML's mysterious Void elements

HTML has several void elements. These cannot have any content, and cannot have separate closing tags.

  • <br>
  • <hr>
  • <img>
  • <input>
  • <link>
  • <meta>
  • <area>
  • <base>
  • <col>
  • <embed>
  • <param>
  • <source>
  • <track>

Closing a void element like this is invalid html.

html
<img alt></img>

Void elements can optionally be self-closing, so these are both correct and identical.

html
<img alt>
<img alt />
Professional headshot
Moulton
Moulton

Hey there! I'm a developer, designer, and digital nomad building cool things with Remix, and I'm also writing Moulton, the Remix Community Newsletter

About once per month, I send an email with:

  • New guides and tutorials
  • Upcoming talks, meetups, and events
  • Cool new libraries and packages
  • What's new in the latest versions of Remix

Stay up to date with everything in the Remix community by entering your email below.

Unsubscribe at any time.