Skip to main content
HTML Validation

Self-closing syntax (“/>”) used on a non-void HTML element. Ignoring the slash and treating as a start tag.

About This HTML Issue

A slash character (/), normally used for self-closing tags, has been found in an unexpected place for a tag, and the validator has decided to ignore it and treat is as a start tag instead.

HTML tags can go in pairs (start tag, end tag) or be self-closing, for example:

<p>This is a paragraph with a start and end p tag</p>
<img src="image.jpg" alt="This is an image with a self-closing tag" />

In HTML5, the ending slash and the preceding space is optional for self-closing tags so all of these are valid:

<img src="image.jpg" alt="This is an image with a self-closing tag" />
<img src="image.jpg" alt="This is an image with a self-closing tag"/>
<img src="image.jpg" alt="This is an image with a self-closing tag">

A common mistake is including a slash tag on a start tag, as in the following example. If the Nu HTML checker encounters that, it will ignore the slash and just treat the tag as a start tag.

<select />
  <option value="1">one</option>
</select>

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Help us improve our guides

Was this guide helpful?

Ready to validate your sites?
Start your free trial today.