Skip to main content

HTML Guide

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

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>

Related W3C validator issues