Ensure required elements are present
- Rule ID:
- element-required-content
- Category:
- Content model
- Standards:
- HTML5
Some elements has requirements where certain child elements has to be present.
The requirements comes from the element metadata:
{
"my-element": {
"requiredContent": ["my-other-element"]
}
}
Rule details
Examples of incorrect code for this rule:
<html>
<head>
</head>
</html>
Examples of correct code for this rule:
<html>
<head>
<title>foo</title>
</head>
<body></body>
</html>