Learn proper HTML and CSS. The guide from Pablo on this site is a good start and of course the sites of W3C. That is the best advise I can give you.
It is all in your source. If the quality of the source file is not too good, it will not work. Also, learn how to make use of stylesheets...
You cannot learn how to fly in a day, not even with deadlines.