It all depends on how complex you want to go. First off, the way to programatically save a notebook (or expression) as HTML is to use
Export["file.html", <<a notebook or a notebook object or an expression>>]
I have found that it takes some experimentation to decide what the right stylesheet elements to modify to get the effects that I want.
When the HTML is created, a CSS is also created based on the stylesheet that it used. I have found that it takes some experimentation to figure out how to get the formatting that I want. But getting this right is a good part of the work, though the defaults work pretty well for general use.
One useful trick is to create a template of an HTML page that you want.... eg, borders and other surrounding elements -- then you import as text the HTML generated by Export, extract the portions that you want to embed in the template and then, using string manipulation techniques, insert it into the template. (One aslo can use String manipulation techniques to modify the resulting HTML -- for example to get rid of the Mathematica branding at the bottom of the page.) This is the approach that I took (if I remember correctly) with this old blog of mine:http://scientificarts.com/worklife/wlfwblog/index.html
y the way, that WorkLife application is something that I give away for free these days... it's an old horse but it still works fine.