Joy Of  Code - Web Design Training and Consulting
Joy Gems Newsletter

The Blind Spot In (X)HTML Validation

Share

By Bud Kraus
bud@joyofcode.com
Joy Of Code
Creator And Instructor

v4 i15
Originally Published: September 25, 2007

If students of mine know one thing they know that, when it comes to code for web pages, I am a perfectionist. They know that I will harass them to validate their source code - for good reason.

Don't know what I'm talking about?

Validation is a process by which your web page - in this case the (X)HTML code - is examined against the World Wide Web Consortium's (w3c.org) standards. They're the smart folks who work on Internet technologies (such as (X)HTML).

While there are many validation methods both online and off, the one I turn to is at the epicenter of web design - the W3C's free validation service. You can check your code whether your page is online or sitting there right in your computer.

What the Validator can tell you are things like:

  • you forgot to close a tag
  • you capitalized a tag when it needs to be in lowercase
  • you need to place an inline tag inside of a block-level tag
  • you forgot to use the alt attribute for the image tag
  • you used a deprecated tag like <font>

Unfortunately, the W3C's Validator doesn't tell you things are incorrect in easy to understand language as I did. However, if you work with it enough you'll understand the geeky explanations it generates.

So, Where's The Blind Spot?

The key point here is that the Validator is only capable of making a quantitative assessment of your page. It really can only check if things are missing or spelled incorrectly. It can only make an objective analysis of your page.

Because of that, there is a blind spot to (X)HTML validation. It cannot tell you if you're using the tags correctly. Consequently, you may get a false sense of security that all is well if your page validates to the W3C specs.

For example, the Validator can't tell you if:

  • you're using a <p> tag when a heading tag would be more appropriate
  • you're using the <br /> tag for a list of items when list markup would be the way to go
  • you're using a table for layout when CSS is the better approach

In other words, it can't do a qualitative assessment of how well - or how poorly you are using the tags. It can't tell you if you are using the tags correctly and/or if there is a tag that is more suitable for what you are trying to do.

In my Great Web Design with CSS Classes I urge students to learn more than the 15 or so tags that most people know. I tell them to use this Index Of Elements to see that there are more than the 15 or so tags out there that they can use for their web pages.

Moral of the story: Don't get fooled by thinking that the world is good when the Validator tells you that your page passes validation. You still need to know how to use the tags correctly and for that there is no machine.

There's only you!!