Validation

What is HTML validation?

World Wide Web Consortium (W3C) allows internet users to check HTML and XHTML documents for well-formatted markup.
Markup validation is an important step towards ensuring the technical quality of web pages.
It checks your HTML against the official HTML specification.

Why is it important?

If your website does not pass validation it may suffer from errors across different browsers or poor traffic owing to poor formatting and readability.

While it's not required to publish a website or page, it is a good habit to validate your webpage after development, or after major changes.

Benefits:

  1. Help Improve Rankings in Search Engines
  2. Validation Helps Teach Best Practices
  3. Improved Website User Experience
  4. Make Website Browsers Friendly
  5. Cross-device Compatibility and Accessibility
  6. Validation Help for Easy Coding and Maintenance
  7. Validation as a Debugging Tool

How do we validate?

You can pass a URL or HTML code into most validators

Useful resources:

Common issues

  • Missing closing tags
  • Incorrect tags
  • Unrecognised attributes or their values
  • Block elements inside inline elements
  • Missing alt attribute
  • Duplicate id attributes