Skip to main content

Top 10 HTML Warnings 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. 56.42%

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” is not serializable as XML 1.0. 14.05%

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.

3. The first occurrence of ID “X” was here. 9.51%

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.

4. The “type” attribute is unnecessary for JavaScript resources. 8.82%

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.

5. Section lacks heading. Consider using “h2”-“h6” elements to add identifying headings to all sections. 5.59%

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.

6. The “listitem” role is unnecessary for element “li”. 1.88%

The <li> element already has an implicit ARIA role of listitem, so explicitly adding role="listitem" to it is redundant. Remove the unnecessary role attribute from your <li> elements, as the browser and assistive technologies already understand their purpose from the semantic HTML alone.

7. Possible misuse of “aria-label”. 1.18%

The W3C validator warns about possible misuse of aria-label when the attribute is applied to an element where it has no effect or is not permitted by the ARIA specification. To fix this, ensure aria-label is only used on elements that have an interactive role, a landmark role, or a role that supports naming — and remove it from generic elements like <div>, <span>, <p>, or other elements where it will be ignored by assistive technologies.

8. The “list” role is unnecessary for element “ul”. 0.89%

The ul element already has an implicit ARIA role of list, so explicitly adding role="list" is redundant. The W3C validator flags this as unnecessary because native HTML semantics should be relied upon instead of duplicating them with ARIA attributes. Simply remove the role="list" attribute from your ul element to resolve this warning.

9. The “charset” attribute on the “script” element is obsolete. 0.83%

The charset attribute on the <script> element is obsolete in HTML5 and will trigger a validation warning. Scripts are required to use the same character encoding as the document, so the attribute is unnecessary and should be removed.

10. The document is not mappable to XML 1.0 due to two consecutive hyphens in a comment. 0.82%

` delimiters of your comments.

Switch to Spanish or Portuguese

Ready to validate your sites?
Start your trial today.