4.1.1 - Valid HTML
Make sure the HTML does not contain markup errors that are known to cause conflicts with assistive technologies (such as incorrect nesting of elements, or duplicate `id`s).
Summary
Make sure the HTML does not contain markup errors that are known to cause conflicts with assistive technologies (such as incorrect nesting of elements, or duplicate id
s).
Requirements (Web only)
- HTML elements have complete start and end tags;
- HTML elements are nested according to their specifications;
- HTML elements do not contain duplicate attributes;
- Any
id
s are unique within a page.
Common mistakes
- HTML elements are not well formed (opened and closed properly);
- HTML
id
attributes use duplicate values within the same page;
Why?
This ensures that content and functionality is presented in a way that works reliably across all supported browsers and assistive technologies.
Official wording in the Web Content Accessibility Guidelines
4.1.1 Parsing: In content implemented using markup languages, elements have complete start and end tags, elements are nested according to their specifications, elements do not contain duplicate attributes, and any IDs are unique, except where the specifications allow these features. (Level A)
See the W3C's detailed explanation of this guideline with techniques and examples.
Guidance for Web
role
attributes are nested correctly
Checking whether elements with ARIA - If you're using the ARIA
role
attribute, look at therole
's definition in the W3C ARIA 1.1 specifications to check whether you're nesting elements with that role correctly.
More guidance for Web
- W3C HTML conformance validator tool
- WCAG 2.0 parsing criterion is a PITA
- Ensuring that
id
attributes are unique on a Web page technique in the Web Content Accessible Guidelines