Skip to main content

Os 10 principais erros de HTML em Espanha

Estes são os principais problemas de HTML encontrados nos sítios Web espanhóis mais importantes para os principais sectores.

Última atualização: quarta-feira, 15 de abril de 2026

1. O atributo "X" não é permitido no elemento "Y" neste ponto. 49.03%

Foi encontrado um atributo inválido num elemento. Verifique a etiqueta afetada para se certificar de que os atributos estão bem formados e, se estiverem, pode considerar a utilização de atributos de dados personalizados.

2. ID “X” duplicado. 11.11%

O atributo id é utilizado para identificar um único elemento dentro de um documento, e deve ser único. Verifique se há IDs repetidos no documento.

3. O elemento "X" não é permitido como filho do elemento "Y" neste contexto. 8.00%

O elemento X não é permitido como elemento filho de Y. Por exemplo, um elemento <ul> não pode ter um elemento filho <div>.

4. Etiqueta final "X" perdida. 7.32%

Foi encontrada uma etiqueta final para X que não corresponde a uma etiqueta aberta anterior. Isto acontece normalmente quando se fecha a mesma etiqueta duas vezes.

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. Um elemento <img> tem de ter um atributo "alt", exceto em determinadas condições. Para mais pormenores, consulte as orientações sobre o fornecimento de alternativas de texto para imagens. 3.93%

As etiquetas <img>, utilizadas para incluir imagens num documento, requerem um atributo alt para descrever o conteúdo da imagem. Isto é essencial para os usuários que não podem ver a imagem (como os usuários de leitores de ecrã), ou como um texto alternativo quando a imagem não pode ser exibida.

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.

Mudar para inglês ou espanhol
🌍 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