Why We Should Always Validate our HTML

validate html

What is HTML Validation?

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

An HTML validator is like a grammar-checker that understands the rules underlying HTML. The validator reads a document and compares it to the set of known rules for a particular kind of document. Any problem the validator reports is an indication that one or more of the known rules has been broken. A “broken rule” can mean anything from a simple typo to genuine butchery of HTML.

So Why Should We Validate our HTML?

Web developers are on the practical side of things. We do what we can to develop web sites that are usable by as many as possible. The practical side of the story is that the majority of web users use Netscape and most of the rest use Microsoft’s Internet Explorer. Web developers must make conformity to the standards that NS and MSIE uses a higher priority than the standards put forth by the W3C.

But the Web is supposed to be device-independent. Documents should render properly on all user agents, including text-only browsers and HTML to speech converters. HTML is not a presentation language, it’s a markup language and all documents should conform to the W3C standards. Your documents should not use vendor-specific extensions, and might not look their absolute best in specific browsers – but they’ll look OK in them all.

Why Web Professionals Choose to Validate their HTML

Here’s some points why web professionals chooses to validate their pages

  • It is a Sign of Professionalism – As of today, there is little or no certification for Web professionals, and only few universities teach Web technologies, leaving most Web-smiths to learn by themselves, with varied success. Seasoned, able professionals will take pride in creating Web content using semantic and well-formed markup, separation of style and content, etc. Validation can then be used as a quick check to determine whether the code is the clean work of a seasoned HTML author, or quickly hacked-together tag soup.

  • It Helps Cross-Browser, Cross-Platform and Future Compatibility – Although you may be able to create a web page that appears to work on your favourite browser (whatever that may be), your page may contain HTML errors (or CSS errors) that do not show up with that browser due to an existing quirk or bug. Another person using a different browser that does not share that particular bug will wind up viewing a page that does not show up correctly. It is also possible that later versions of your browser will fix that bug, and your page will be broken when people use the latest incarnation of the browser.

  • Validation eases Maintenance – It is reasonable to consider that standards such as HTML and CSS are a form of “coding style” which is globally agreed upon. Creating Web pages or applications according to a widely accepted coding style makes them easier to maintain, even if the maintenance and evolution is performed by someone else.

  • Validation helps Teach Good Practices – Many professionals have been authoring the Web with HTML and CSS for years and know these technologies by heart. Beginners and students, on the other hands, will find automated checking tools invaluable in spotting mistakes. Some teachers also stress that automated validation tests are a good introduction to broader, more complex quality concepts such as accessibility.
    Coding your pages so that it is correct without errors will result in pages that are more likely to work across browsers and platforms (ie, different systems). It is also a form of insurance against future versions of browsers, since all browsers aim towards compliance with the existing HTML and CSS standards.

  • Search Engine Visibility – When there are errors in a web page, browsers typically try to compensate in different ways. Hence some browsers may ignore the broken elements while others make assumptions about what the web designer was trying to achieve. The problem is that when search engines obtain your page and try to parse them for keywords, they will also have to make certain decisions about what to do with the errors. Like browsers, different search engines will probably make different decisions about those errors in the page, resulting in certain parts of your web page (or perhaps even the entire page if your error is early in the page) not being indexed.

    The safest way, it is held, is to make sure that your web page validates error-free. That way, there is no dispute about which part of your page should be scanned for keywords and the like.

How Often Should I Validate?

Some people validate every time they make a modification to their pages on the grounds that careless mistakes can occur any time. Others validate only when they make a major design change.

I always validate the template for my pages when I make a major design change. I try to validate my pages each time I make modifications before I make my pages go live.

You can always validate your pages at http://validator.w3.org/

  1. Envelonna

    hi, new to the site, thanks.

Leave a Reply