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.

<img alt></img>

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

<img alt>
<img alt />
Professional headshot

Hi, I'm Jacob

Hey there! I'm a developer, designer, and digital nomad with a background in lean manufacturing.

About once per month, I send an email with new guides, new blog posts, and sneak peeks of what's coming next.

Everyone who subscribes gets access to the source code for this website and every example project for all my tutorials.

Stay up to date with everything I'm working on by entering your email below.

Unsubscribe at any time.