HTML5 Canvas 100% Width Height of Viewport?
问题 I am trying to create a canvas element that takes up 100% of the width and height of the viewport. You can see in my example here that is occurring, however it is adding scroll bars in both Chrome and FireFox. How can I prevent the extra scroll bars and just provide exactly the width and height of the window to be the size of the canvas? 回答1: In order to make the canvas full screen width and height always, meaning even when the browser is resized, you need to run your draw loop within a