Skip to main content

Top 10 HTML Errors

Web developers worldwide have found 455 million HTML issues on 12 million checked web pages.
Here are the most common issues detected by Rocket Validator.

Last update: Saturday, June 27, 2026

1. Element “X” not allowed as child of element “Y” in this context. 48.46%

The W3C HTML Validator raises this error when an element is placed inside a parent element that doesn't allow it according to the HTML specification. Each HTML element has a defined content model that specifies which child elements are permitted. To fix this, restructure your markup so that child elements match what the parent element expects.

2. Attribute “X” not allowed on element “Y” at this point. 17.50%

The W3C HTML Validator reports this error when an attribute is used on an HTML element that doesn't support it according to the HTML specification. This can happen because the attribute is misspelled, belongs to a different element, is an obsolete attribute, or is a custom attribute that isn't using the data-* prefix. To fix it, remove the invalid attribute, correct any typos, move it to an appropriate element, or convert custom attributes to the data-* format.

3. Duplicate ID “X”. 16.69%

The id attribute must be unique within an HTML document — no two elements can share the same id value. When the W3C validator reports "Duplicate ID," it means the same id has been assigned to more than one element. To fix this, ensure every id in your document is distinct, or switch to class when you need to apply the same identifier to multiple elements.

4. An element with the attribute “tabindex” must not appear as a descendant of the “a” element. 4.52%

An element with a tabindex attribute must not appear as a descendant of an <a> (anchor) element. This creates conflicting focus targets within an interactive element, confusing keyboard navigation and assistive technologies. To fix this, remove the tabindex attribute from any descendant elements inside the <a> element, or restructure your markup so that interactive or focusable elements are not nested inside links.

5. An “img” element must have an “alt” attribute, except under certain conditions. For details, consult guidance on providing text alternatives for images. 3.98%

Every <img> element must include an alt attribute that provides a text alternative for the image. This attribute is critical for accessibility—screen readers rely on it to describe images to users who cannot see them—and it also serves as fallback text when the image fails to load. To fix this issue, add an alt attribute to every <img> tag, setting it to a meaningful description or to an empty string (alt="") for purely decorative images.

6. No space between attributes. 2.78%

HTML attributes must be separated by at least one whitespace character (space, tab, or newline). When attributes are placed directly next to each other without a space between them, the W3C HTML Validator will report an error. The fix is straightforward: ensure there is a space between each attribute in every HTML element.

7. Bad value “” for attribute “target” on element “a”: Browsing context name must be at least one character long. 1.99%

The target attribute on an <a> element cannot be an empty string. When target is present, it must contain at least one character — either a valid browsing context keyword (like _blank, _self, _parent, or _top) or a custom name for a browsing context. To fix this, either remove the target attribute entirely or provide a valid value.

8. Element “img” is missing one or more of the following attributes: “src”, “srcset”. 1.62%

Every <img> element must include at least a src or a srcset attribute to be valid HTML.

9. When the “srcset” attribute has any image candidate string with a width descriptor, the “sizes” attribute must also be specified. 1.36%

When an img element's srcset attribute contains image candidates with width descriptors (e.g., 400w, 800w), the sizes attribute must also be present. Without sizes, the browser has no way to determine how large the image will appear in the layout, making it impossible to choose the correct source from the candidate list. To fix this, add a sizes attribute that describes the image's expected display width at various viewport sizes.

10. Duplicate attribute “X”. 1.10%

Each HTML element must have unique attribute names — no attribute can appear more than once on the same element. When the W3C validator reports "Duplicate attribute," it means an attribute like id, class, or any other has been specified two or more times on a single element. To fix this, merge the duplicate attributes into a single declaration or remove the unintended repetition.

Switch to Spanish or Portuguese
🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
$7 / 7 days

Pro Trial

Full Pro access. Cancel anytime.

Start Pro Trial →

Join teams across 40+ countries