[font=verdana]As long as you’re writing HTML or fauXHTML, browsers will be pretty tolerant of errors in your code … but remember, if you ever start writing real XHTML, a single validation error will bring the entire page crashing down and it will display nothing except an error message.
And the key words there are “pretty tolerant”. Browsers are generally good at working out what people meant to write and what they wanted to happen, but they aren’t psychic and they don’t always get it right. Sometimes the code is so broken that they don’t have a clue what to do … but what is more common is that one browser (usually the one that the author is using!) guesses correctly what was intended, but others don’t … and that’s when you get buggy layouts that don’t work properly in some browsers. You’d be amazed how often layouts that appear screwed up in one browser but not another can be tracked down to validation errors.
But … your page works fine in all major browsers around today. Do you need to worry about validation?
I would say “yes”, for three reasons.
1 - you haven’t tested your site in every possible browser out there, so there’s a risk that if it has any bugs in the code, these might manifest themselves in a browser you’ve not tried. OK, so it won’t affect a huge number of people, but it will affect some, and that’s a problem for those people.
2 - you haven’t tested in browsers that haven’t been released yet. The bugs that you’ve got in your code might still give the results you wanted in Chrome 24, but who is to say that they won’t wreak havoc when Chrome 25 comes along? Get into good habits now, and it will serve you well in the future.
3 - in most cases, there’s no reason not to write valid code. If you’ve got unencoded ampersands in your URLs or badly nested elements, fix them! It isn’t a big deal, and it won’t break anything. Because having errors that you don’t need to have leads to the next point …
4 - the chances are that your site is not complete or finished, you will be adding to it or changing it. And one day when you’re making one of those changes, you make a little mistake with the code and introduce a validation error. And this one does cause problems. So you go to run the page through the validator to find the source of the problems and Whoa! There’s a hundred errors on that page, most of them absolutely nothing to do with this problem, but now you’ve got to sift through all of them to find the one that’s causing the issue.
I’m not saying that every page must validate. I have pages that don’t validate, for a variety of reasons. But the thing is, I know what those reasons are. And those are cases where I have made a conscious decision that I want to use code that I know isn’t technically valid, I know why it isn’t valid, and I know what the risk of it causing problems is. If you don’t take that care, you run the risk of it going pear-shaped.[/font]