I saw last post similar to my question HTML5 canvas style height vs attribute height
But in that post, there was no clear information regarding which one will work and
1) style here is the attribute of HTML element, what is written inside the quote is CSS code. Likewise, width here is the attribute of . However, tag doesn't have width attribute see here (under attributes) More information on HTML attributes: here
see DEMO
2) width="200" is equivalent to width="200px"