Where Knowledge Rules

Computers & Technology:

Internet

Get a Widget for this title

Reasons for doing HTML validation

'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.
Contact this writer Click here to send this author comments or questions.


Below are the top articles rated and ranked by Helium members on:

Reasons for doing HTML validation

Add your voice

Know something about Reasons for doing HTML validation?
We want to hear your view. Write_penWrite now!

Helium Debate

Cast your vote!

Does Cuil.com pose a real threat to Google?

Click for your side.

102314

Featured Partner

Appleseed

Appleseed, a nonprofit network of 16 public interest justice centers in the United States and Mexico, uncovers and co...more

What is Helium? | Buy Web Content | Contact Us | Privacy | User agreement | DMCA | User Tools | Help | Community | Helium’s Official Blog | Link to Helium

Helium, Inc.
200 Brickstone Square Andover, MA 01810 USA