4.1.1. Write valid HTML code according to the grammar rules of the DOCTYPE used

On each page, a DOCTYPE must be used, and the HTML code must be valid according to the rules of the selected DOCTYPE. The choice of DOCTYPE is open.

It is especially important to:

  • Correctly nest the tags.
  • Provide the corresponding closing tag for each opening tag.
  • Avoid duplicate attributes for the same tag.
  • Ensure the uniqueness of each id attribute within a page.


Only validation errors are to be corrected. The warnings returned by the validator do not need to be taken into account with respect to this criteria, because they have no impact on accessibility.



Including ARIA attributes in the HTML code is a real advantage for accessibility but will invalidate the source code if the page is not produced in HTML5. If errors are returned following the inclusion of these attributes, they do not need correcting.

notices/html-css/ecrire-un-code-html-valide-selon-les-regles-de-grammaire-du-doctype-utilise.txt · Last modified: 30 December 2013 at 17:37 by Sébastien Delorme (Atalan)

Project coordinated by Atalan.

In partnership with: