Top 10 HTML Issues 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. Trailing slash on void elements has no effect and interacts badly with unquoted attribute values. 36.30%
Trailing slashes on void elements like <br/>, <img/>, or <hr/> serve no purpose in HTML and are ignored by browsers. However, they can cause subtle bugs when combined with unquoted attribute values, because the slash may be parsed as part of the last attribute’s value rather than as a self-closing indicator. The simplest fix is to remove trailing slashes from all void elements.
2. Attribute “X” not allowed on element “Y” at this point. 23.09%
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. Attribute “X” is not serializable as XML 1.0. 9.04%
Attribute names containing certain characters — such as curly braces, template syntax markers, or control characters — cannot be represented in XML 1.0 and will trigger this validation error. This commonly happens when template placeholders (e.g., {{variable}}) or special characters are accidentally left in the rendered HTML output. To fix it, ensure all dynamic expressions are properly resolved before the HTML is served, and that attribute names only contain valid characters.
4. Duplicate ID “X”. 6.12%
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.
5. The first occurrence of ID “X” was here. 6.12%
Duplicate id attributes in an HTML document cause validation errors, accessibility problems, and unpredictable JavaScript behavior. The W3C validator flags this message to point you back to the first element that uses a given id, helping you locate where the duplication begins. To fix it, ensure every id value appears only once per page by renaming or removing the duplicates.
6. The “type” attribute is unnecessary for JavaScript resources. 5.68%
Since HTML5, the default scripting language for <script> elements is JavaScript, making type="text/javascript" redundant. The W3C validator flags this as an unnecessary attribute. Simply remove the type attribute from any <script> tag that loads or contains JavaScript.
7. Element “X” not allowed as child of element “Y” in this context. 3.98%
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.
8. Stray end tag “X”. 3.69%
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.
9. Section lacks heading. Consider using “h2”-“h6” elements to add identifying headings to all sections. 3.60%
The W3C HTML Validator warns when a <section> element does not contain a heading (<h2>–<h6>). The <section> element is intended to represent a thematic grouping of content that typically has its own heading. To fix this, either add a heading element inside each <section>, or consider using a different element like <div> if the content doesn’t represent a distinct, named section.
10. When the “srcset” attribute has any image candidate string with a width descriptor, the “sizes” attribute must also be specified. 2.39%
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.
Ready to validate your sites?
Start your trial today.