Lesson 1: Validating Your HTML


In this lesson, you will have an opportunity to use the W3C HTML Validator, and to correct invalid code based on validation tool feedback. An invalid web page might look fine in your browser, but someone accessing the page in another browser might have an entirely different experience with the same content. Valid HTML assures that all standards-compliant browsers will display the page reliably.

Learner Outcomes

At the completion of this exercise:


Validate a Sample Page

  1. Open the sample invalid web page . Does this page display ok in your browser?
  2. View the web page's source code. Can you find the HTML errors?
  3. Save the sample invalid web page on to your local drive.
  4. Now try testing this file using the W3C HTML Validator. Use the "Validate by File Upload" method and upload the file that now resides on your local drive.
  5. What HTML errors does the validator find? Did it find any errors that you overlooked?
  6. Correct the first problem found by the Validator, then save the web page, and retest. Sometimes one error in the web page has a domino effect that results in multiple validation errors, so it's usually a good idea to just fix one error at a time, the retest.
  7. Repeat this process until the document passes the validation test.

Validate Your Own Pages

  1. Validate all web pages you have created in this course using the W3C HTML Validator.
  2. Correct any problems found by the Validator, then retest until each of your web pages passes the validation test.

Resources/Online Documents

All done?

Share your web site with your instructor, so they can confirm that it has valid HTML. Then proceed to the the next lesson.