HTML Guide
An end tag </code>
has been found violating nesting rules. Check other errors in the same document related to the <code>
element, and fix the unallowed nested elements.
Related W3C validator issues
An </a> end tag has been found to violate nesting rules. <a> tags can’t include other <a> tags inside. Most probable cause is an unclosed <a> tag, like in this example:
<a href="one.html">Page 1
<a href="two.html">Page 2</a>
A <div> tag has been found as a direct child of an <ul> tag, and this is not allowed. For example, <ul><div><li>item</li></div></ul> is not valid, but <ul><li><div>item</div></li></ul> is valid as the direct child of <ul> is <li>.
The element X is not allowed as a child element of Y. For example, a <ul> element cannot have a <div> child element.
An end tag </b> has been found in an incorrect place within the document, violating nesting rules. A common case is closing it before closing other nested tags, for example:
<!-- This line is incorrect as the <b> tag was closed before the nested <a> tag -->
<b><a href="#">link</b></a>
<!-- This line is OK as every end tag respects the nesting rules -->
<b><a href="#">link</a></b>
An end tag </em> has been found in an incorrect place within the document, violating nesting rules. A common case is closing it before closing other nested tags, for example:
<!-- This line is incorrect as the <em> tag was closed before the nested <a> tag -->
<em><a href="#">link</em></a>
<!-- This line is OK as every end tag respects the nesting rules -->
<em><a href="#">link</a></em>
A closing </body> tag has been found, but there are unclosed elements before it. For example this has an unclosed <section> element:
<body>
<section>
</body>
An end tag </strong> has been found in an incorrect place within the document, violating nesting rules. A common case is closing it before closing other nested tags, for example:
<!-- This line is incorrect as the <strong> tag was closed before the nested <a> tag -->
<strong><a href="#">link</strong></a>
<!-- This line is OK as every end tag respects the nesting rules -->
<strong><a href="#">link</a></strong>
And end tag has been found that does not match the current open element. Check the context to fix the start and end tags.
A heading element (h1, h2, h3, etc.) can’t be nested inside another heading element.
Here’s an example of invalid HTML code:
<h1>Main heading
<h2>Sub heading</h2>
</h1>
To fix this issue, you should ensure that each heading element is properly nested within the document hierarchy. Headings should only be used to indicate the structure of your content, not to style it.
Here’s an example of valid HTML code that properly uses heading elements:
<main>
<h1>Main heading</h1>
<section>
<h2>Section heading</h2>
<p>Paragraph content</p>
</section>
</main>
In this example, the heading elements are used to denote the structure of the document, with the h1 element indicating the highest level heading and the h2 element indicating a subheading within a section. Notice that in the valid example, each heading element is only used once and is not nested within another heading element.
Some times this can be caused by a typo in the end tag for a heading, for example:
<h3>Meet the Feebles<h3>
In order to fix this issue, the end tag should be </h3> in the example above.
An end tag has been found after the closing </body> tag, which breaks the expected HTML document structure.
Check out the document structure, a basic example follows:
<!DOCTYPE html>
<html lang="">
<head>
<title>Test</title>
</head>
<body>
<p></p>
</body>
</html>