Saturday, August 28, 2010

Creating Valid HTML Documents Means Cleaner Code and Easier Maintenance

Learning to validate your HTML is an important step for most designers. By writing valid HTML you ensure that your pages are standards compliant and will run on the most user agents and web browsers.

Building web pages isn't hard. With the software that is available now, you can write your web page and have it up and viewable in half an hour or less. And with these tools, why would you need to run an HTML validator on your HTML to find errors? Well, you don't have to, but if you want your pages to stay viewable through future versions of HTML, or you want newer browsers to be able to display it correctly, then writing valid HTML is the place to start.

There are several specific reasons for writing valid HTML, and using an HTML validator to insure that what you write is valid:

Compatibility with future versions of HTML and web browsers
As browsers evolve, they come closer and closer to supporting the standard HTML as written by the W3C. Even if they don't fully support the most recent version of HTML, the browser builders go in and make sure that they are compliant with older versions of the standard. If you are writing non-standard HTML, there is a chance that as browsers evolve, they will no longer support your web pages. A good example of this is a trick that some web developers used with an older version of Netscape. If you included multiple body tags with different colors, Netscape would load them all in succession creating a fade-in or flicker effect as the page loaded. This trick no longer works, as it relied on an incompatibility of the browser.
Accessible to Your Current Audience
Unless you know for a fact that your entire audience is using a specific browser, you are setting your site up to annoy some of your readers if you make it inaccessible to them through invalid or non-standard HTML. Many HTML validators will check your HTML for browser specific entities and alert you to their use. Browser specific HTML can be part of the standard or not a part of the standard. Don't assume that just because only one browser supports something it's non-standard. Or if multiple browsers support it, that it is part of a standard. For instance, HTML 5 is supported by Safari, Opera, Chrome, and Firefox, but it is not yet a recognized standard.
Reduce Unexplained Errors
I am often asked to look at web pages for people to tell them why the code is doing something strange. I can usually come back in just a few minutes and tell them what is wrong. Why? It's not because I know HTML inside and out, it's because I run their page through an HTML validator. This usually points out a problem with the HTML, that, when fixed, solves their problem as well.
HTML Validators
There are a lot of validators available. You can get ones that are run on your computer, embedded into your HTML editor, or online on your live web pages.


  1. I am glad that I saw this post. It is informative blog for us and we need this type of blog thanks for share this blog, Keep posting such instructional blogs and I am looking forward for your future posts.
    Cyber Security Projects for Final Year

    JavaScript Training in Chennai

    Project Centers in Chennai

    JavaScript Training in Chennai

  2. Steam or turning cleaners for floor coverings utilize a genuinely mellow items so they are a great decision. Be that as it may, you can even now abuse them so pursue the headings cautiously.carpet cleaning NYC

  3. it was a wonderful chance to visit this kind of site and I am happy to know. thank you so much for giving us a chance to have this opportunity.. Pest control Abu Dhabi

  4. I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work. Beg bug Control Abu Dhabi

  5. Disposable nuisance dust masks to protect the wearer from exposure to coarse, non-toxic particles. Molded to the face with an elastic strap. These masks are lightweight so are easy to breathe through and do not restrict the vision.

    n95 coronavirus mask

  6. Even if an agent can’t sell your house, we can help. (Sometimes selling a house through a real estate agent is not for everyone.)

    We Buy Houses St Francis WI