Thursday, October 9, 2008

Tips for W3C Validation in HTML

All the site must be validated by http://validator.w3.org/ before making into live and present before to the end user.

What is Validation?

Validation is a process of checking your documents against a formal Standard, such as those published by the World Wide Web Consortium (W3C) for HTML and XML-derived Web document types, or by the WapForum for WML, etc.

The original version was written by Nick Kew of WebÞing Ltd. for their Site Valet service and he has generously donated it for our use.


Reason for Validate a site in W3C?

Well, firstly there is the very practical issue that non-valid pages are (by definition) relying on error-correction by a browser. This error correction can and does vary radically across different browsers and versions, so that many authors who unwittingly relied on the quirks of Netscape 1.1 suddenly found their pages appeared totally blank in Netscape 2.0. Whilst Internet Explorer initially set out to be bug-compatible with Netscape, it too has moved towards standards compliance in later releases. Other browsers differ further.

Tips for W3C Validation in HTML

1. < table> tag should not contain the 'height' property,

Ex: < table height="100" is wrong
< table style="height:100px;" is right


2. < img> tag should have the 'alt' property

Ex: Ex: < img .. alt=""> is right
< img ..> is wrong


3. < img>, < hr >, < br > etc tags should contain the end tag,
Ex: < img .. />, < hr ../>, < br />, < input .. /> right
< img ..>, < hr >, < br >, < input .. > wrong


4. No tag must be in Capital letters, all tag must be in small case
Ex:
(i). < div >...< /div > is right
< DIV >...< /DIV > is wrong
(ii). onclick is right
onClick is wrong


5. All the tags should contain opening tag, closing tag and with proper closing

Ex: < p >< font >< /p >< /font > is wrong
< p >< font >< /font >< /p > is right

No comments:

Popular Posts