APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

Validating your html

Validating your HTML pages is important, but it also can be frustrating and annoying. It's important both for your readers and for accurate search engine indexing or contextual ad display: if your HTML is broken, you may not get the impact or results you expect.

It's not enough to "validate" by looking at the page in your own browser. Browsers forgive a lot of sins and will do their best to display even very poorly done pages. However, your browsers tolerance for glitches and mistakes may be much different than mine and therefore what I see may be quite a bit different than what you intended (unfortunately it is sometimes very different even if your HTML is perfect, but that's a different topic). A search engine spider indexing your pages may be confused without strict HTML syntax, so it really becomes necessary to "do it right".

I used to use the Firefox toolbar extension Web Developer, but you can just go to http://validator.w3.org/ and enter your pages directly. You'll need to put a DOCTYPE Declaration on your pages for that to work. If your pages have problems, you'll get a listing of the errors.

Don't panic if you get dozens of errors. One simple problem at the beginning of the page can trigger multiple errors as the validation continues. It can sometimes be difficult to see the original problem, but if you fix that, all the rest of the "errors" can magically disappear. If it's really difficult, just excise sections of your page until the errors go away, and then put everything back slowly so that you can narrow down where the mistake is.

Another impediment comes from embedded scripts: the validator sees the result of the scripts, which throws off the line numbering. You'll want to check off the "Show Source" option to help with that.

See Tidy also.


Got something to add? Send me email.





Increase ad revenue 50-250% with Ezoic


More Articles by

Find me on Google+

© Tony Lawrence



Kerio Samepage


Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us





People who are more than casually interested in computers should have at least some idea of what the underlying hardware is like. Otherwise the programs they write will be pretty weird. (Donald Knuth)

The people I distrust most are those who want to improve our lives but have only one course of action in mind. (Frank Herbert)







This post tagged: