Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL

Message Too Old, No Replies

Validating Your Site and Code?

Is it that important!

3:36 pm on Jun 20, 2008 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 28, 2004
posts: 55
votes: 0


After some advice from other members I have spent the last 5 days recoding to validate my site and just wanted to know how important you felt it was?

Have you taken the time to do it? and what are the plus's?

8:09 pm on June 20, 2008 (gmt 0)

Preferred Member

5+ Year Member

joined:Dec 10, 2007
votes: 0

It gives more consistent results across all browsers, and having valid code makes it easier to spot any bugs/problems that may arise in the future when you come to change the code and layout, as you've already eliminated one potential problem - invalid code.

Some say that search engines like valid code, but if thats the case, then why dont google themselves validate their home page?


9:47 pm on June 20, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
votes: 0

Some say that search engines like valid code,

Jury's out on that one - but I think, in terms of search engines, a definite benefit is it forces you to clean up your code. Cleaning up your code and using semantic HTML exposes your content more efficiently. And that can't be bad for search engines in any case.

As mentioned, cross-browser rendering is #1 of my reasons for validating.

1. Valid documents, which inherently require using a valid doctype, cause browsers to render your pages in in Standards mode. See #2.

2. For the longest time, I couldn't figure out why some of my CSS didn't work, or worked in one browser and not the other. Then I realized it was because a) I was using a "half" document type and b) my code didn't validate. A document in quirks mode will cause some CSS methods to fail. Validating your pages helps assure that CSS is functioning as you expect.

3. Validating your code forces you do do all of it right, or if not right, at least to standards. For example, in Standards mode, ffffff is not a color - it needs the pound sign, #ffffff. Another common instance is most people don't use the alt tag because they don't understand it's purpose, or are just annoyed by the IE yellow "pop up" that appears over images. Missing alt tags will choke the validator every time - and it explains why you need them. So validation is an education-in-process that keeps you centered, it forces you to dot those "i's", cross those "T's" . . .

4. Validating helps you eliminate deprecated elements, such as <font> and <center>. This also applies to forcing you to clean up your code; when you rip out all the font tags and other deprecated tags, what is left? Your content!

5. Validating makes it easier to understand the relevance of using the correct doctype [webmasterworld.com] and so much easier to move to other doctypes if required. A valid 4.01 strict document is a few short steps away from an XML doctype.

6. It gives you a first plan of attack whenever things go wrong. Watching this recent thread [webmasterworld.com], I will guess that this will lead the poster to a positive solution in very short order. This is almost always the first stop if things are going wrong.

7. Valid documents are a prerequisite to accessible documents - although that is another issue entirely, the document must first validate before you can address accessibility.

8. It gives other designers who would steal your clients one less thing to pick at, and one more thing to support quality control in your work.

9. When you wonder, "Am I doing this right, is there a better way?" a validator does just that - helps you validate your coding decisions.