Top 10 HTML Errors in Portugal
These are the main HTML issues found in the most prominent Portugal websites.
The website list is curated by Ruben Ferreira Duarte, A11Y trainer and editor of the DXD blog
Last update: Monday, June 1, 2026
1. Attribute “X” not allowed on element “Y” at this point. 35.94%
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.
2. Duplicate ID “X”. 28.85%
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.
3. Element “X” not allowed as child of element “Y” in this context. 12.10%
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.
4. An “img” element must have an “alt” attribute, except under certain conditions. For details, consult guidance on providing text alternatives for images. 6.43%
Every <img> element must include an alt attribute that provides a text alternative for the image. This attribute is critical for accessibility—screen readers rely on it to describe images to users who cannot see them—and it also serves as fallback text when the image fails to load. To fix this issue, add an alt attribute to every <img> tag, setting it to a meaningful description or to an empty string (alt="") for purely decorative images.
5. Bad value “” for attribute “target” on element “a”: Browsing context name must be at least one character long. 5.41%
The target attribute on an <a> element cannot be an empty string. When target is present, it must contain at least one character — either a valid browsing context keyword (like _blank, _self, _parent, or _top) or a custom name for a browsing context. To fix this, either remove the target attribute entirely or provide a valid value.
6. Element “img” is missing one or more of the following attributes: “src”, “srcset”. 3.15%
Every <img> element must include at least a src or a srcset attribute to be valid HTML.
7. Duplicate attribute “X”. 2.93%
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. Bad value X for attribute “src” on element “img”: Illegal character in path segment. Space is not allowed. 2.48%
Spaces in the src attribute of an img element are not valid URL characters and must be encoded as %20 or replaced with hyphens/underscores.
9. Bad value “tel: X” for attribute “href” on element “a”: Illegal character in scheme data. 1.52%
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.
10. Stray end tag “X”. 1.20%
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.
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