If you’re going to do it, do it right.

Use CSE HTML Validator to validate your HTML and CSS.  It offers advice beyond syntax errors, like warning about variation in browser support for different constructs, and providing basic accessibility testing.  I highly recommend it.

The W3 HTML Validator isn’t as good, but it’s free.  The W3 CSS Validator works well. 

The Web Design Group’s (WDG) offline validator is particularly handy for scripting.