Disallows void element with content

Rule ID:
void-content
Category:
Content model
Standards:
  • HTML5

HTML void elements cannot have any content and must not have an end tag.

Rule details

Examples of incorrect code for this rule:

<img></img>
error: End tag for <img> must be omitted (void-content) at inline:1:7:
> 1 | <img></img>
    |       ^^^^


1 error found.

Examples of correct code for this rule:

<img>
<img/>