'What are the reasons for doing HTML validation?'
Firstly, by doing so you are checking that your code meets the requirements as set out by the W3C (http://www.w3c.org) so that your HTML or XHTML mark up,displays and parses as its supposed to in your users' browser.
Its therefore important that you choose a correct DOCTYPE so that when validating your code, the validator knows what colour or flavour of HTML/XHTML you are using in order for it to carry out validation. For example, if your mark up has depreciated tags such as FONT or ALIGN and you use a STRICT doctype, then your document will immediately fail the validation process as your mark up is not XHTML or HTML strict.
Its very easy to leave tags or elements open by mistake and the validator will pick up these errors so that you can fix them quickly and easily.
In a nutshell, validating your code successfully means that you have taken the time and patience to create standards compliant and operable web pages that meet the current web standards as set out by the World Wide Web Consortium (W3C).
You can even validate your CSS files as well,this is equally as important as validating your HTML mark up. For example, you may attempt to validate a CSS document and the validator will return a result with the following error:
Line 50:No colour given with your background colour"
This means that in your CSS file on line 50 you may have the following style rule:
.block{
background-color:# 000000;
font-family:Arial,verda na,san-serif;}
As the background colour is black (#000000) and there is no colour for the font that is given, then the browser would revert to it default colour (usually black) which would mean that the text inside the 'block' div class would not be seen. The validator is instructing you to put in the following line of CSS code:
color:#FFFFFF; (in this example we have used white.)
You can use any other colour of your choice as long as its not the same as the background colour as the validator will fail your attempt to validate successfully.
Learn more about this author, John Stephen Jones.
Click here to send this author comments or questions.
Below are the top articles rated and ranked by Helium members on:
As an advocate for web standards, my philosophy for validation is that it shows that your code is standards compliant.
So you wish to know what in the world would valid HTML do for you? How is it a benefit to know how to do so? Well, that
I write my HTML code by hand, and being human I make mistakes. Even if you don't always write your HTML directly, mistakes
The World Wide Web Consortium also known as W3C is an international organization committed to the development of protocols
'What are the reasons for doing HTML validation?'
Firstly , by doing so you are checking that your code meets the requirements
Add your voice
Know something about Reasons for doing HTML validation?
We want to hear your view.
Write now!
Featured Partner
Appleseed, a nonprofit network of 16 public interest justice centers in the United States and Mexico, uncovers and co...more
hide