HTML Guide
A closing tag </li> has been found, but there were open elements nested inside the <li>. You need to close the nested elements before you close the <li>.
A closing tag </li> has been found, but there were open elements nested inside the <li>. You need to close the nested elements before you close the <li>.
For example:
<li>
<span>example
</li>
The above is invalid because you need to close the <span> tag before you close the <li>.
This would be valid:
<li>
<span>example</span>
</li>
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.
An end tag has been implied from the context, but there were open elements. Check other issues in the same document for open tags that need to be closed.
For example, the following will raise a “end tag li implied” issue, because the span element inside the li has not been properly closed.
<ul>
<li><span>text<li>
</ul>
Instead, this is correct:
<ul>
<li><span>text</span><li>
</ul>
Your HTML markup contains an end tag for X, but there are nested open elements that need to be closed first. For example, <li><span>example</li> is invalid because you need to close the <span> tag before you close the <li>. This would be valid: <li><span>example</span></li>.
A character has been found in the document that is not allowed in the charset encoding being used.
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.
HTTP status code 202 means the server has accepted the request but has not completed processing it, so the validator cannot retrieve the resource.
The W3C HTML Validator needs to retrieve external resources (like linked CSS or JS files, images, or even your webpage itself) and expects a successful 200 OK HTTP status code. If it gets a 202 Accepted instead, the resource is not fully available for validation, which prevents it from fetching and checking the content.
Causes:
- Your server is responding with a 202 Accepted and processing in the background instead of serving the full content immediately.
- You might be testing a URL that triggers background processing, a queue, or is incomplete.
- If your resource is an API or dynamic endpoint, make sure to provide a static, direct file with a 200 OK response for validation.
How to fix:
- Configure your server to respond with 200 OK and immediately provide the requested content for HTML documents or resources.
- Avoid validating URLs that return 202 Accepted. Only validate URLs serving complete resources.
The validator is blocked from accessing an external resource such as a stylesheet, script, or image due to a 403 (Forbidden) HTTP status.
This means that the HTML references a resource (often in a link, script, img, or iframe element) at a URL that is denying access—possibly due to server permissions, IP restrictions, or hotlink protection. The validator needs to retrieve these resources to check them, so HTTP 403 errors will prevent validation of external resources.
The “HTTP resource not retrievable” error with an HTTP status code of 404 indicates that the W3C Validator could not find a specific web page by its URL. This error occurs when the URL provided for a page is incorrect, or the page no longer exists at the given address.
HTTP status code 502 means the validator could not reach your resource because of a “Bad Gateway” error.
This error occurs outside of your HTML code—it indicates a problem with the communication between servers, not with the markup. The validator cannot retrieve your HTML page because your site, web host, or proxy between the validator and your server returned a 502 response, possibly due to server overload, misconfiguration, or a temporary networking issue.
To address this:
- Ensure your website is online and publicly accessible.
- Check your server or hosting provider for outages or firewall/redirect settings.
- Confirm there are no restrictions (like IP blocking or authentication requirements) preventing external access.
- Wait for temporary outages to resolve, or contact your hosting support if the error persists.
The “HTTP resource not retrievable” error with an HTTP status code of 503 indicates that the W3C Validator could not access a web page referenced in your HTML. This error occurs when the remote server hosting the page is temporarily unavailable or overloaded.
A 504 HTTP status error means the validator was unable to retrieve your HTML document due to a server timeout, not because of any syntactic issue in your HTML.
The W3C Validator retrieves your page over HTTP(S) to check its HTML; a 504 (“Gateway Timeout”) indicates the server did not respond in time. This can be caused by server configuration, network problems, or firewall/restriction policies.
To resolve, check if your website is publicly accessible, loads quickly for external visitors, and isn’t blocking the validator’s requests. If your website requires authentication, is on a private network, or restricts certain IPs, external tools like W3C’s validator won’t be able to access it.
For persistent network errors, consult your web hosting provider or server administrator to resolve connectivity issues.
The character encoding declared in the HTML differs from the actual file encoding.
The meta element with charset="utf-8" tells browsers to interpret the document as UTF-8. However, if the file is actually saved in another encoding (such as Windows-1252), validators and browsers will detect a mismatch, leading to this error. To resolve this, you must ensure the file contents and the encoding declaration match.
Recommended: Save your document in UTF-8 encoding to match your meta tag.
Alternatively, if you must use Windows-1252, update charset accordingly.
UTF-8 example (preferred):
<!DOCTYPE html>
<html lang="en">
<head>
<title>UTF-8 Encoding Example</title>
<meta charset="utf-8">
</head>
<body>
<p>This page is encoded in UTF-8.</p>
</body>
</html>
Windows-1252 example (not recommended):
<!DOCTYPE html>
<html lang="en">
<head>
<title>Windows-1252 Encoding Example</title>
<meta charset="windows-1252">
</head>
<body>
<p>This page is encoded in Windows-1252.</p>
</body>
</html>
Summary:
- Use UTF-8 as your file encoding and declare <meta charset="utf-8">.
- Always make sure the file is saved using the same encoding you declare in the HTML.
The document has been declared to use a windows-1251 charset but the actual contents seems to be utf-8. You should update the charset to that like in this example:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
The label element may only contain one labelable descendant.
For example:
<label for="age">
Age
<select id="age">
<option>young</option>
<option>old</option>
</select>
</label>
In HTML5 you’re encouraged to use Unicode (UTF-8) character encoding rather than a legacy character encoding such as Latin1 (Windows-1252 or ISO 8859-1).
In short, it can be just a matter of using <meta charset="utf-8"/> in your document, but you should also ensure that your pages are also saved and served as UTF-8.
The document could not be properly parsed due to malformed characters. Check the document encoding.
<meta> tags, used for defining metadata about HTML documents, must appear within the <head>...</head> section, but it has been found out of place. Check the document structure to ensure there are no <meta> tags outside the head section.
A common cause of this issue is having a duplicated, out of place <head>...</head> section. Ensure that this section appears in its proper place and is the only container for <meta> tags.
The W3C HTML Validator issue “Misplaced non-space characters inside a table” usually occurs when there are text nodes (or other elements) that are not properly placed within table elements. In HTML, all text content should be contained within table cells.
How to Fix the Issue
To resolve this issue, ensure that all text content is placed inside <td> or <th> elements, which are the valid child elements of <table>, <tr>, and related elements. Here’s how you can identify and fix the issue:
Example of Incorrect Table Structure
<table>
<tr>
Hello World <!-- This is misplaced content -->
<td>First Cell</td>
<td>Second Cell</td>
</tr>
</table>
Corrected Table Structure
<table>
<tr>
<td>Hello World</td> <!-- All text should be inside <td> or <th> -->
<td>First Cell</td>
<td>Second Cell</td>
</tr>
</table>
Guidelines
-
Text Content: Ensure that all text (including any headers or titles) is wrapped in <td> (for data cells) or <th> (for header cells). Keep in mind that event the non-breaking space character ( ) counts as text.
-
Table Structure: Remember a typical structure for a table includes <table> containing one or more <tr> elements, which in turn contain the <td> or <th> elements.
-
No Direct Text Nodes: Avoid having any direct text nodes outside of the cell elements within the table.
An end tag </p> has been found that cannot be matched for an opening tag <p>. Most of the times this is due to closing the same tag twice, for example:
<p>some text</p></p>
Attributes in HTML elements need to be separated by space, in this example the first line is invalid and the second one is valid:
<a href="page.php"class="big">link</a>
<a href="page.php" class="big">link</a>
And end tag for element X has been found with no corresponding opening tag for it. Most of the times this is due to closing the same tag twice.
Placing text or non-space characters between the </body> and </html> tags is not allowed.
According to the HTML specification, the </body> tag must be immediately followed by either whitespace (spaces, tabs, newlines) or the closing </html> tag, with no visible content or other characters, as the body of the document must end before </body>. Any characters appearing after </body> are considered outside the document body and violate W3C compliance.
Invalid example:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Example</title>
</head>
<body>
Content goes here.
</body> this is invalid
</html>
Valid example:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Example</title>
</head>
<body>
Content goes here.
</body>
</html>
Ensure that nothing except optional whitespace appears after </body> and before </html> to resolve this validation issue.
Rocket Validator checks HTML on your sites using the latest version of W3C Validator Nu HTML Checker, which is intended for HTML5 documents.
The page scanned is using an obsolete doctype, instead of the expected <!DOCTYPE html>.