Skip to content

28 – HTML Lint (html-validate)

The test runs html-validate against the page's HTML.

What is tested?

Among the checks are:

  • that attributes are separated by whitespace
  • that attribute values are permitted
  • that attributes are used in the right context
  • that end tags don't carry attributes
  • that elements are closed in the correct order

Invalid HTML isn't merely a matter of form. Browsers quietly correct what they can, but screen readers, search engines and older browsers guess differently. A page that only works thanks to the browser's error handling breaks in unpredictable ways.

How it affects the score

Each rule violation counts at its severity. Structural errors, such as elements closed in the wrong order, weigh more heavily than formalities.

Running the test

python default.py -u https://example.com -t 28 -r

Worth knowing

Webperf previously used the W3C validation service (test 6). It was replaced by html-validate, which can run locally and therefore puts no load on someone else's service.

See also