HTML can be tricky, there is lots of little bugs and unexplained errors that can come up for most web designers. But for a website to run smooth and fast validating the website is essential. To do this you need it to be checked by a credited validation service. The best one currently is: W3.org the url is: http://validator.w3.org/
Some programs have basic version built in like the Dream Weaver HTML Check Up but nothing will work (to be honest) even close to W3.
Another trick is to try to stay away from tables, they might seem easy to work with but they will make the page load slower and in some browsers shape differently. Scripts like WordPress and Drupal can help keep the code clean for you too!
Good luck with your code and remember to have fun with web design, it shows in your work.