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

Validating your html


Some material is very old and may be incorrect today

© December 2005 Tony Lawrence

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.

If you found something useful today, please consider a small donation.



Got something to add? Send me email.





(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

->
-> Validating your html


Inexpensive and informative Apple related e-books:

Take Control of Numbers

Take Control of Upgrading to El Capitan

Take Control of iCloud

Take Control of the Mac Command Line with Terminal, Second Edition

Sierra: A Take Control Crash Course





More Articles by © Tony Lawrence





Printer Friendly Version

Have you tried Searching this site?

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


Printer Friendly Version





Beware of bugs in the above code; I have only proved it correct, not tried it. (Donald Knuth)




Linux posts

Troubleshooting posts


This post tagged:

Blogging

Web/HTML



Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode