Top 10 HTML Warnings
Web developers worldwide have found 327 million HTML issues on 10 million checked web pages.
Here are the most common issues detected by Rocket Validator.
Last update: Friday, December 6, 2024
1. Trailing slash on void elements has no effect and interacts badly with unquoted attribute values. 62.41%
Void elements, like area
, base
, br
, col
, embed
, hr
, img
, input
, link
, meta
, source
, track
, and wbr
are self-closing and don’t need a trailing slash /
, which should be avoided as that can interfere with unquoted attribute values.
2. The first occurrence of ID “X” was here. 15.23%
Element IDs in an HTML document must be unique. The HTML validator is indicating the first occurrence of an ID that is repeated. Check the details for that issue to see web pages affected, and the elements within them, to fix that ID repetition.
3. The “type” attribute is unnecessary for JavaScript resources. 11.51%
The default type
for <script>
tags is JavaScript
, so you don’t need to include the type for JS resources.
4. The document is not mappable to XML 1.0 due to two consecutive hyphens in a comment. 2.23%
Malformed comment syntax has been found, check out the affected comment.
HTML comments are helpful to leave notes about the code right next to it. To create a comment, it must start with <!--
and end with -->
.
5. Attribute “X” is not serializable as XML 1.0. 2.21%
An attribute could not be parsed from the HTML input, probably due to a typo. Check this guide for a related HTML issue.
6. Section lacks heading. Consider using “h2”-“h6” elements to add identifying headings to all sections. 2.09%
The <section>
element can be used to define sections of a document, like chapters, tabbed content, etc. Consider using a heading element (any of <h2>
to <h6>
) to present each section.
7. Possible misuse of “aria-label”. 1.62%
The aria-label
attribute is used to define a string that labels the current element. Use it in cases where a text label is not visible on the screen. This attribute does not work consistently with all HTML elements, so the W3C validator is warning about a possible misuse.
8. The “type” attribute for the “style” element is not needed and should be omitted. 1.62%
The HTML <style>
element contains style information for a document, or part of a document, defined in CSS. This element does not need the type
attribute anymore, so it should be omitted.
9. Article lacks heading. Consider using “h2”-“h6” elements to add identifying headings to all articles. 0.55%
The <article>
element can be used to define complete, self-contained compositions of a document, for example blog posts. Consider using a heading element (any of <h2>
to </h6>
) to present each article.
10. The “navigation” role is unnecessary for element “nav”. 0.53%
The navigation
landmark role is used to identify major groups of links used for navigating through a website or page content. It can be added to an element that contains navigation links by using role="navigation"
, but instead it’s preferable to just use the <nav>
element. In that case, it’s unnecessary to make the navigation role explicit.
Ready to validate your sites?
Start your trial today.