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: Sunday, February 15, 2026

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

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”. 13.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.51%

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.89%

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.11%

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”. 4.02%

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

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

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.

8. Duplicate attribute “X”. 3.18%

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.

9. Element X is missing required attribute Y. 2.61%

Certain HTML elements have attributes that are mandatory according to the HTML specification. When the W3C validator reports that element X is missing required attribute Y, it means you’re using an element without an attribute the spec considers essential for that element to function correctly. Adding the missing required attribute to the element resolves the issue.

10. CSS: “X”: Parse Error. 2.19%

The W3C validator’s CSS parser encountered a syntax error while trying to interpret a CSS declaration. This “Parse Error” means the CSS code contains something the parser cannot recognize as valid CSS — whether it’s a typo, an unsupported syntax, a misplaced character, or a malformed value. To fix it, carefully review the flagged CSS for syntax mistakes, missing or extra characters, and non-standard properties or values.

Switch to Spanish or Portuguese

Ready to validate your sites?
Start your trial today.