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

Validating your html

© May 2019 Anthony 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 use the Firefox toolbar extension Web Developer, but you can just go to https://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.

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

Printer Friendly Version

-> Validating your html

Inexpensive and informative Apple related e-books:

Take Control of Automating Your Mac

Sierra: A Take Control Crash Course

Take Control of IOS 11

Take Control of Numbers

Take Control of Parallels Desktop 12

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

The danger of computers becoming like humans is not as great as the danger of humans becoming like computers. (Konrad Zuse)

Linux posts

Troubleshooting posts

This post tagged:



Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode