I’ve noticed over the years that there are a lot of websites that consist of horrendous code. I just never understood why people fail to validate their code. Writing error-free HTML is the best way to help ensure that pages render optimally in as many browsers as possible. This includes older, as well as, future browsers. I’m sure you’ve heard the old saying, “Measure twice, cut once.” It goes the same with writing code: Write it right the first time and write it once. Write it wrong, and you will probably end up writing it again later.
The best way to ensure that web pages render properly in web browsers i to write good HTML and CSS from the start. Most problems that end users come across when visiting websites are often due to bad HTML. There are a lot of designers out there that will spend more time learning CSS hacks to fix their cross-browser problems, rather than learn how to properly write code. Sadly, I just Googled “CSS hacks” and came up with 1,230,00 results. That is just ridiculous.
There are plenty of reasons for you to validate your code. If you want your site listed on search engines, and let’s be honest, who doesn’t – then make sure you have good HTML. Many search engines cannot properly index a site that has serious errors. This will in turn greatly reduce the amount of traffic you receive from search engines. Another reason si that properly written HTML will render harder, better, faster, stronger (sorry, was listening to Daft Punk as I wrote this). Seriously, validated pages render better, render on more browsers, and render faster than pages with errors. Also, with the number of people browsing the internet via their cell phones, validated code is more easily adapted to alternative browsing devices.
If you haven’t gotten the gist of what I have been rambling about by now, it’s validate your code. http://validator.w3.org/