Return to Course Content Home

HTML Validation

Lesson Objectives

  1. Students will be able to validate the structure of an HTML document

Required Reading

None

HTML Validation

At this point, you can make an HTML web page and mark things up. The good news is that browsers are notoriously forgiving of mistakes, and tend to fail silently. After all, if something is wrong, the browser can choose to simply not apply any attributes and render it as regular text. If you think about it, this is a good thing, users don't want to be bothered with errors in a page because it was designed for IE, but they are using Firefox which doesn't recognize some of IE's custom HTML extensions. You've probably seen the results of this type of error when a page just...doesn't....quite....look right.

The bad news is that even if you try to do a good job marking up a document, how do you know if you've really done a good job? It turns out that many of the modern IDEs for web pages (e.g. Dreamweaver) will tell you as you compose a page what problems you have.

An alternative is to use an HTML validation service. It just so happens that the World Wide Web Consortium (W3C) has a service that will validate your HTML. In fact, you can choose to have their validate look at an active web page, or uploaded code, or even type in a chunk of HTML for it to validate.

If you go to https://validator.w3.org, you will see the following page:

HTML validation page

 

You type the text into the address and click on the check button...

This is the first page of the validation output. In this case it found 5 errors. If you scroll down the page, you would see the following:

More validation output

This tells you exactly what your errors are. There are other sources of HTML validators. Below is an example of a Firefox plugin that performs the same service.

Final HTML validation