List of HTML Self-Closing Tags

By Xah Lee. Date: . Last updated: .

Here's a complete list of self-closing tags for HTML5. These are called “void-elements” in HTML spec.

  1. <area />
  2. <base />
  3. <br />
  4. <col />
  5. <embed />
  6. <hr />
  7. <img />
  8. <input />
  9. <link />
  10. <meta />
  11. <param />
  12. <source />
  13. <track />
  14. <wbr />

The space before the slash is optional.

Is the Ending Slash Optional?

I recommend to always add the slash. Because, it provides a visual clue of non-closing tags.

XHTML Supports Self-Closing Syntax for All Tags

In XML/XHTML, any tag can be self-closed by the ending slash <… />.

When you test XML, you have to make sure the server is sending the correct Internet media type as XHTML (For example, application/xhtml+xml), otherwise browsers will treat it as HTML, regardless of the DOCTYPE in your file.

Reference

https://www.w3.org/TR/html/syntax.html#void-elements

HTML Basics

  1. HTML Basics
  2. HTML5 Tags
  3. Case Sensitivity
  4. Allowed Characters
  5. Charset and Encoding
  6. Self-Closing Tags
  7. Multiple Class Value
  8. HTML/XML Entity List
Liket it? Put $5 at patreon.

Or, Buy JavaScript in Depth

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials

  1. HTML
  2. Visual CSS
  3. JS in Depth
  4. JS Reference
  5. DOM
  6. SVG
  7. Web Dev Blog