Mobipocket Creator can take the HTML file and turn it into a mobi .prc file, and lets you add the cover, metadata, etc. It can also create the TOC for a properly formatted file. To designate chapter headings or other items to include in the TOC, each one must be tagged the same based on a hierarchy. For example,
Chapter headings - h2
--Chapter subheadings - h3
I really stink at explaining this.

Sorry.
Here is a pdf of HTML tags and css that the Kindle recognizes:
Kindle HTML tags
This document and the site it is on (
http://kindleformatting.com) should give you a better idea of how it works in comparison to how a web page would work. It's like a web page in a different package, with a limited but still capable set of options.