Validate required element ancestors

Rule ID:
element-required-ancestor
Category:
Content model
Standards:
  • HTML5

HTML defines requirements for required ancestors on certain elements.

Rule details

Examples of incorrect code for this rule:

<area>
error: <area> element requires a <map> ancestor (element-required-ancestor) at inline:1:2:
> 1 | <area>
    |  ^^^^


1 error found.

Examples of correct code for this rule:

<map>
    <area>
</map>

Version history