No replies
Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 1 week 21 hours ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Why Validate


If your just starting off down the road to coding using "standards", one of your best friends is going to prove to be "Validation".
The validation service provided by the W3C is a free online service that will test your pages for errors
in your HTML/XHTML coding using the specifications and requirements set out in the "Document Type Declarations" that you place at the start of your page and which govern how the browser interprets your code.
If as likely you are using CSS to style your pages then the W3C also offer the Jigsaw Validator that will check through your Style Sheets.

The reason that I say it will be your best friend is that, if you make use of the service from an early stage in your work and re-validate at regular and frequent intervals through the development of your code then you will pick up on many small errors that otherwise may have had you looking in all the wrong places trying to discover the reason your layout is not working when it was just a case of a simple missing closing tag in a deep nested list or use of Deprecated Tags etc.

I would warn first timers validating their pages that the output from the W3C validator can be a little daunting and you may well find some of it's warnings less than clear ( that's an understatement!) and you may crash back in total despair when looking at 157 listed errors; but don't panic the best way of dealing with the validator errors is to not worry about the number of them as often one error has a knock on effect and produces others.
Look for clear problems such as unclosed tags and fix those, don't attempt to go off and fix every single error, fix a few then revalidate. You will be surprised how often fixing one problem will clear up quite a few others.

It would be sensible at this stage, to also mention the most best method of working with standards compliant code, which is to code for the most compliant Standards aware browser first then check your work in less Compliant offerings such as IE6.

Working this way, you will find far fewer cross browser errors than if you coded for IE.

At this moment in time I think most Designers/Developers would probably agree that Mozilla's Firefox is the most Standards Aware and compliant browser available and it has some essential extensions-available from Firefox Extensions to aid the developer; namely the "Web Developer Tool Bar" (which has tools such as element outlining, CSS editing on the fly and many other invaluable items) and the extension to "Source view" that gives you an automatic validation of the source code courtesy of "Tidy" which means that basic errors are picked up well before they become a problem.

There is another reason that validating through your work will aid you and that is through clearing up basic and obvious errors in your code, you will be better able to determine that the problems you are experiencing are something which you require more detailed help with.

When you come to post a question you can be safe in the knowledge that it is unlikely to be due to something daft and you will gain the respect of those whom you ask help of, as you have demonstrated a willingness to attempt to solve some of the problems yourself and it goes a long way in gaining fast and useful advise.

So in conclusion; make a point of validating your code as often as you can, find those little errors before they accumulate and code to the most compliant browser then check backwards through the less compliant offerings.
Just following these small points will make things a lot easier and will allow us to give help and advice where it's really needed rather than just pointing out the lack of a DTD.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Tags: