Hofstadter's Law
http://en.wikipedia.org/wiki/Hofstadter%27s_law :)
Seriously though. I usually do work breakdown structures (e.g. HTML+CSS for layout is one task, content styling is another task, widget styling, javascript to drive each UI element are quoted individually, forms individually, etc etc.
The idea is that you should be able to estimate tasks that you do often fairly accurately since you do them often.
In addition, I increase the estimated time by a percentage to account for things like bug fixes, back and forth with the rest of the team, client feedback, etc. Each item has its own multiplier (e.g. a client might be difficult, so you up the multiplier for that)