Os 10 principais erros de HTML em Portugal
Estes são os principais problemas do HTML encontrados nos sítios Web mais importantes de Portugal. A lista de sítios Web foi organizada por Ruben Ferreira Duarte, formador em A11Y e editor do blogue DXD
Última atualização: domingo, 1 de março de 2026
1. O atributo "X" não é permitido no elemento "Y" neste ponto. 32.51%
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. 32.02%
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. 12.81%
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. Valor incorreto "" para o atributo `target` no elemento `<a>`: O nome do contexto de navegação deve ter pelo menos um carácter. 6.65%
O atributo target em elementos <a> não pode estar em branco.
5. 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. 5.60%
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.
6. Duplicate attribute “X”. 3.17%
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.
7. Bad value “tel: X” for attribute “href” on element “a”: Illegal character in scheme data. 1.96%
The href attribute on an <a> element contains an illegal character in the URI scheme data. This commonly occurs with tel: links when a space is placed after the colon, but it applies to any URI scheme (mailto:, tel:, http:, etc.) with invalid characters. Remove the space or illegal character immediately following the colon to fix the issue.
8. Element “div” not allowed as child of element “ul” in this context. 1.95%
A <div> element has been placed as a direct child of a <ul> element, which violates the HTML specification. The <ul> element only permits <li>, <script>, and <template> elements as direct children. To fix this, either move the <div> inside an <li> element, or restructure your markup so the <ul> contains only valid children.
9. Bad value “X” for attribute “src” on element “img”: Illegal character in path segment: space is not allowed. 1.90%
Spaces in URLs used in HTML attributes like src are not valid according to the URL specification. When the W3C validator encounters a space in an img element’s src attribute, it reports an illegal character error. To fix this, replace each space with %20 (percent-encoding) or restructure the URL to avoid spaces entirely.
10. Etiqueta final "X" perdida. 1.45%
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.
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.
Pro Trial
Full Pro access. Cancel anytime.
Start Pro Trial →Join teams across 40+ countries