Top 10 HTML Issues 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: Sunday, March 1, 2026
1. Trailing slash on void elements has no effect and interacts badly with unquoted attribute values. 34.43%
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” not allowed on element “Y” at this point. 13.82%
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.
3. Duplicate ID “X”. 13.61%
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.
4. The first occurrence of ID “X” was here. 13.60%
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.
5. Attribute “X” is not serializable as XML 1.0. 7.37%
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.
6. Element “X” not allowed as child of element “Y” in this context. 5.44%
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.
7. The “type” attribute is unnecessary for JavaScript resources. 5.11%
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.
8. Bad value “” for attribute “target” on element “a”: Browsing context name must be at least one character long. 2.83%
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.
9. An “img” element must have an “alt” attribute, except under certain conditions. For details, consult guidance on providing text alternatives for images. 2.38%
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.
10. Section lacks heading. Consider using “h2”-“h6” elements to add identifying headings to all sections. 1.42%
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.
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