Skip to main content

Top 10 HTML Errors in Spain

These are the main HTML issues found in the most prominent Spain websites for the main sectors.

Last update: Wednesday, April 15, 2026

1. Attribute “X” not allowed on element “Y” at this point. 49.03%

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.

2. Duplicate ID “X”. 11.11%

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.

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

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.

4. Stray end tag “X”. 7.32%

A "Stray end tag" error occurs when the HTML parser encounters a closing tag (</X>) that doesn't match any currently open element. This typically happens due to duplicate closing tags, mismatched nesting, or closing tags left behind after editing. The fix is to locate and remove the orphaned end tag or correct the document structure so every closing tag has a corresponding opening tag.

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

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.

6. The “aria-label” attribute must not be specified on any “span” element unless the element has a “role” value other than “caption”, “code”, “deletion”, “emphasis”, “generic”, “insertion”, “paragraph”, “presentation”, “strong”, “subscript”, or “superscript”. 5.15%

A span element has an implicit ARIA role of generic, and the aria-label attribute is not allowed on elements with that role.

7. Duplicate attribute “X”. 4.21%

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.

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

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.

9. A “link” element with an “as” attribute must have a “rel” attribute that contains the value “preload” or the value “modulepreload”. 2.81%

The as attribute on a <link> element tells the browser what type of resource is being fetched, but it only makes sense in the context of preloading. If your <link> element uses the as attribute, its rel attribute must be set to "preload" or "modulepreload". To fix this, either add the correct rel value or remove the as attribute if you're not preloading a resource.

10. Bad value “X” for attribute “type” on element “a”: Subtype missing. 2.65%

The type attribute on an <a> element expects a valid MIME type (such as application/pdf) to hint at the media type of the linked resource. This error occurs when the value provided is not a properly formatted MIME type — it's either missing a subtype (e.g., application instead of application/pdf) or is not a MIME type at all (e.g., button). To fix this, either provide a complete and valid MIME type in the format type/subtype, or remove the type attribute entirely if it's not needed.

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