I would l开发者_Python百科ike to know how to align a canvas element to the absolute top ( 0 , 0 ) of the web page.
I have tried: margin: 0; padding: 0px;
but no good.
There's always some white space at the top.
Make sure your "body" and "html" have no padding:
body, html { padding: 0; margin: 0; }
Then make sure the canvas is either "naturally" positioned at the top, or else is absolutely positioned.
Consider using a reset.css when designing web pages, this will clear out any and all default styles that most browsers will inject as default. I like this one: http://yuilibrary.com/yui/docs/cssreset/
精彩评论