Learning HTML 3.2 by Examples, section 2 How to study HTML 3.2:

Checking your HTML

When you have started creating and maintaining important HTML documents, you should learn to use a validator, i.e. a program which checks your HTML code syntactically against the HTML 3.2 (or some other) specification.

Even if you know HTML 3.2 well, you will occasionally violate the specification by accident; for instance, just forgetting an ending quote can cause a lot of such violations. Since different browsers have different error handling, you may not notice the error in your environment but your readers may get confused.

It is not sufficient to check that "it works" on your browser. Other people will use that browser in a different environment or with different settings, different versions of the browser, or even quite different browsers. Browsers very often pass invalid HTML without giving error messages, perhaps even handling in such a way that things seem to work fine. For other people, it might be a mess. Looking at your document on a few different browsers may help to detect problems, but it would be too tedious to do that for all important browsing environments.

Therefore, validate your code. There are online services ( i.e. Web pages which contain forms which accept a URL of a document and send back the validation report. One of them is the W3C HTML Validation Service which you can use for example through the following simple form:

Although all (real) validators do the same basic job, there are some differences e.g. in how understandably they report errors. For such reasons, you might find it useful to check the WDG validator.

Notice that quite often a single error in your document causes a lot of error messages from a validator. The reason is that a structural error may cause a validator to "get out of phase" when analyzing your document. Thus, fix as many validation errors as you can from the beginning of the error report, then submit for validation again.

Passing validation means that there are no violations of HTML syntax (providing that the validator does its job right). It does not imply overall good quality, of course, just one component of quality.

Yet another important issue is checking the links. One of the worst problems in Web authoring is "linkrot": links easily become invalid. (Well, they might be invalid from the very beginning, too, if you mistyped the URL.) Documents to which you have linked might just be deleted, moved to another location, or be changed so that they become useless as regards your purposes of linking, due to deletion of some information or to not being updated to reflect actual changes in the state of affairs. Automated tools can be of some help here. For instance, NetMechanic allows you to send a URL to be checked for technical validity of links, and it will send you back an E-mail message telling you where you pick up its report.

For more information, see Heikki Kantola's nice compact list of validators and checkers and WDG's (annotated) extensive list of validators and checkers.

Date of last update: 2010-12-16.
This page belongs to the free information site IT and communication, section Web authoring and surfing, by Jukka "Yucca" Korpela.