Check It Out - W3C's HTML And CSS Validators
(Part 1 of 2)
By Bud Kraus
bud@joyofcode.com
Joy Of Code
Creator And Instructor
Originally Published: Mar 2005
If you're like me when I was starting to learn HTML (even while I started teaching it at Pratt Institute in New York City at the end of the last millennium) I didn't even know what validation was. For those early days I say, "Shame on me." I just didn't know better and had to have a friend turn me on to validation.
What is Validation
It's the process by which we check files - html, css and other things - to see if they comply with industry standards. Fortunately we have computers to go thru our code, line by line, to make sure all is copacetic. And if it's not we get a report to tell us where the errors are in our files.
Once we remove the errors we get a little treat -- a "well-formed document."
Why Validate?
For some, the process of validation gets in the way as they create web content. That's a fairly dangerous attitude.
Integrate validation into your creative process. Once that becomes part of the way you do things, you'll thank me for it. As I like to say, "Validate early and often."
There are three real good reasons why you want to validate your work. Each of them support the principle of adherence to specifications.
1. It Helps Resolve Cross-Browser, Cross-Platform And Future Compatibility Issues
By creating files that are syntactically correct, you stand the highest probability that your page will work properly in the greatest number of devices, software and operating systems available today or emerging tomorrow. Using the most widely supported industry standards is a method of safeguarding your designs against future shock.
Validating XHTML/HTML files does not ensure browser compatibility but it is a step in the right direction. This is not as big an issue as it is with CSS for reasons too many to get into right now. You're still going to have to review your files in multiple browsers but, since we are dealing only with structure here, the browser compatibility issue will not rear its ugly head as it will with CSS.
2. Search Engine Visibility
Creating well-formed documents means using syntax that search engines, like Google, love. Without getting too techy here, search engine spiders crawl through web sites and index your pages so that others may find you. By using the elements and attributes as they are supposed to be used, your pages are more easily understood by search engines and, therefore, reached by more users.
3. It's A Learning Tool
Once you starting validating your files you'll find the process to be an invaluable learning experience. Validation itself will teach you what are the best ways to create your XHTML/HTML and CSS files. Validation is a great teacher.
The more you use validation, the faster you'll be able to create well-formed documents because you won't be making the same mistakes over and over again.
