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, December 15, 2024

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

An invalid attribute has been found on an element. Check the affected tag to ensure attributes are well-formed, and if they are you can consider using custom data attributes.

2. Duplicate ID “X”. 15.38%

The id attribute is used to identify a single element within a document, and is required to be unique. Check the document for repeated IDs.

3. Stray end tag “X”. 8.66%

An end tag for X has been found that does not correspond to a previous open tag. This usually happens when you close the same tag twice.

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

The element X is not allowed as a child element of Y. For example, a <ul> element cannot have a <div> child element.

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

Check the HTMLImageElement.srcset guide to learn about the correct usage of the srcset and sizes attributes.

6. CSS: “X”: Parse Error. 4.10%

A CSS definition for an X property could not be understood by the parser. Check it to ensure that it’s well formed and that it contains an appropriate value.

7. Element X is missing required attribute Y. 3.54%

The element X requires an attribute Y, but it’s not present. Check that element and add the required attribute, like in <X Y="value">.

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

<img> tags, used to include images on a document, require an alt attribute to describe the contents of the image. This is essential for users that cannot see the image (like screen reader users), or as an alternate text when the image cannot be displayed.

9. Element “img” is missing required attribute “src”. 2.88%

<img> tags used to display images require the attribute src to indicate the source of the image, for example <img src="/img/photo.jpg" />.

10. Element X is missing one or more of the following attributes: “role”. 1.96%

An element is using ARIA attributes, but its role has not been defined. ARIA defines semantics that can be applied to elements, with these divided into roles (defining a type of user interface element) and states and properties that are supported by a role. Authors must assign an ARIA role and the appropriate states and properties to an element during its life-cycle, unless the element already has appropriate ARIA semantics (via use of an appropriate HTML element).

Read about Using ARIA: Roles, states and properties.

Switch to Spanish or Portuguese

Ready to validate your sites?
Start your trial today.