edit Michelle Knight on July 14, 2011
edit W3C Validator: A Spell & Grammar Checker for Website Code
Like a readable Word document, a clean website makes a good impression on your customers. You use a spell and grammar checker to catch errors in your text. Use the W3C validator tool to find errors on your website.
Similar to word processing applications, web browsers do not distinguish invalid from valid statements. Your websites may look fine at first glance, but have compromised functionality. For example, a missing link or some invalid test may lose people, who want to know about your product.
edit Comparing Web Markup & Web Standards Using W3C Validator
The W3C validator compares web pages and websites that use the (X)HTML languages with a set of standards. Led by Web inventor Tim Berners-Lee, the W3C - or World Wide Consortium - sets these web coding specifications based on conversations and review from an international community of web industry leaders and public commentators.
The resulting specifications represent a consensus on good web markup practices, and define the creation of well formed web pages. These rules form the backbone of the W3C validator's reports on any errors or warnings found when checking web code.
The W3C validator does more than tell you how many errors and warnings it found after checking the web language. It also lists the line, an explanation and a recommendation for each error and warning.
If parsing through lines of markup is not an option for you, the W3C validator provides the choice to clean it up using HTML-Tidy. This is especially handy after creating a web site or web page using a third-party software application. However, W3C Validator, and related HTML-Tidy option may overlook some types of web code that are not HTML and are used to perform more complex web programming, such as Java, ASP or PHP. Also the validator may miss more complex issues caused by the relationship between different pages and content problems.
edit Steps To Use the W3 Validator
- Open the W3C Validator. Click on http://Validator.W3.org to open the W3C Markup Validation Service.
- Decide where you wish to check the code. You can check your website markup directly, using a web browser. Alternatively, you can download the W3C Validator to your local machine to validate unfinished web pages not ready for the public eye, or private web pages.
- Enter what you wish to check. Type the web address in the Address field. This is in the "Validate by URI" tab. Alternatively you can upload a local file through the "Validate by File Upload" tab. If you wish to check the code directly, then choose the "Validate by Direct Input" tab. Copy your HTML code and paste into the empty field below.
- Choose options, as needed, to view the validation results. Select the "More Options" arrow for selections. Choices include "Character Coding" or text language (e.g. Italian), "Document Type" or type of markup, listing error messages sequentially vs by type of error, displaying the web source, displaying the web outline, cleaning the markup language, validate web pages that have a "404 not found" error or "Validate Error Pages" and "Verbose Output" or more description of the error
- Press Check. The W3C validator will start and complete its check. It will report on any deviations from the standard web X(HTML) language you specified.
edit Don't Rely on Only the W3C Validator
While the W3C validator saves time by catching basic mistakes on websites, a W3 validator is not always a good substitute for more robust web-site testing. The W3C validator catches mistakes on the surface, but not the deeper issues.
For example, some web code may interact with applications needed for security and/or to manipulate data. Also, some websites may present different kinds of media; such as images, video and sound. A W3C validator will not judge the quality of these, other than whether the file is referred to correctly by the markup. If you are looking to validate website links or a web style sheet, the W3C validator will not fit the bill. Different web browsers may have quirks in the code that does not recognize valid HTML. Finally, the W3C validator cannot be used to validate content for mobile phones, see 9 Ways to Misunderstand Web Standards. Links to these alternative tools are available on the W3C Validator web page.
Should you forgo or supplement the W3C Validator, based on these drawbacks, for another tool? It depends how you define the quality of your website and how much chance you wish to take on how many errors appear on your website.
Images: Copyright © 03 Aug 2011 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University). All Rights Reserved.