How do I markup a page with an HTML5 canvas such that the canvas
canvas
Takes up 80% of the width
Has a corresponding pixel h
in order to center the canvas within the window +"px" should be added to el.style.top and el.style.left.
el.style.top
el.style.left
el.style.top = (viewportHeight - canvasHeight) / 2 +"px"; el.style.left = (viewportWidth - canvasWidth) / 2 +"px";