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 ids).


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 ids 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

Checking whether elements with ARIA role attributes are nested correctly

  • If you're using the ARIA role attribute, look at the role's definition in the W3C ARIA 1.1 specifications to check whether you're nesting elements with that role correctly.

More guidance for Web