title: Size of HTML5 Canvas via CSS versus element attributes
body: <p>I don't get why the following pieces of code produce different results, because css would scale the canvas as it was zoomed in, </p>
  
  <pre><code>&lt;style&gt;
  #canvas {
      width: 800px;
      height: 600px;
  }
  &lt;/style&gt;
  &lt;canvas id="canvas"&gt;&lt;/canvas&gt;
  </code></pre>
  
  <p>In contrast with this approach (that works as expected):</p>
  
  <pre><code>&lt;canvas id="canvas" width="800px" height="600px"&gt;&lt;/canvas&gt;
  </code></pre>