Many people think of validation as a mark of valor so they can put on their web page the little W3C logo proclaiming they have achieved some poetic, high moral platform. In truth, validation is error checking. Validation means your markup contains the proper syntax that browsers will understand and should render properly.
Some people think that just because their code displays properly in their browser there is no need to validate or correct any validation errors. Nothing could be further from the truth. Browsers are required to do the best they can with invalid code. There are even some recommendations on what a browser should do in certain error conditions but these recommendations do not cover all situations.
It is difficult enough to debug error-free, valid markup without having to try and debug error filled, invalid markup.
You cannot expect a browser to respond the same way to an error from version to version and you cannot expect one browser maker to respond the same as a different browser maker. Relying on errors to be consistent is an error itself. In addition, XHTML and XML are less forgiving of errors than HTML is.
Therefore, at intervals in your coding process, you should visit the W3C HTML Validator and don't forget the W3C CSS Validator. There you can upload your files, supply a URL, or directly enter your markup to be checked for validity.
Remember, too, that having valid code does not mean your page will work. You can have elements placed out of order and illogically and still have valid code.