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.

29 comments:

  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

    ReplyDelete
  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

    ReplyDelete
  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

    ReplyDelete
  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

    ReplyDelete
  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

    ReplyDelete
  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

    ReplyDelete
  7. 우리카지노 100%안전 검증된 카지노사이트 만 엄선하여 소개해드립니다 국내 업계1위 우리카지노계열 전통이 있는 온라인카지노 에서 안전하고 편안한 게임을 ..

    우리카지노

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. Gone through this wonderful coures called Salesforce Certification Training in Dallas who are offering fully practical course, who parent is Salesforce Training in USA and they have students at Salesforce Training classes in Canada institutes. So never too late to start learning at Salesforce Training in Australia even though you don't have any programming knowledge you can excell in Salesforce Training in London United Kingdom (UK) because it is all about your customers, so this time find the best Salesforce Training in Europe. This way we will learn Salesforce CRM.

    ReplyDelete
  10. I am really inspired with your writing talent well with the layout to your weblog. Is this a paid topic or did you modify it your self? Anyway stay up the excellent high quality writing, it’s rare to peer a great blog like this one nowadays. new york website design company

    ReplyDelete
  11. I have just seen this at a preview screening in London. web design agency new york

    ReplyDelete
  12. This comment has been removed by the author.

    ReplyDelete
  13. This sounds in a way inflammatory pending me…can’t wait for this…thank you! san francisco design agency

    ReplyDelete
  14. Thank you for your very good information and respond to you. used car in san jose sf design agency

    ReplyDelete
  15. contact lens are not only for fashion but it can also protect your eyes from dust and UV radiation., web design la

    ReplyDelete