Size of HTML5 Canvas via CSS versus element attributes -


i don't why following pieces of code produce different results, because css scale canvas zoomed in,

<style> #canvas {     width: 800px;     height: 600px; } </style> <canvas id="canvas"></canvas> 

in contrast approach (that works expected):

<canvas id="canvas" width="800px" height="600px"></canvas> 

the explanation here: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#attr-canvas-width seen in post, thanks!

the intrinsic dimensions of canvas element equal size of coordinate space, numbers interpreted in css pixels. however, element can sized arbitrarily style sheet. during rendering, image scaled fit layout size.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -