Lesson 1: Validating Your HTML
Overview
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:
- you will be able to test a web page using the W3C HTML Validator.
- you will have gained practice interpreting the Validator results and applying them toward correcting invalid HTML code.
Activities
Validate a Sample Page
- Open the sample invalid web page . Does this page display ok in your browser?
- View the web page's source code. Can you find the HTML errors?
- Save the sample invalid web page on to your local drive.
- 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.
- What HTML errors does the validator find? Did it find any errors that you overlooked?
- 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.
- Repeat this process until the document passes the validation test.
Validate Your Own Pages
- Validate all web pages you have created in this course using the W3C HTML Validator.
- 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.