Quiero CANVAS (parte gris) para cubrir siempre la pantalla.
Pero cubre demasiado.
¿Qué hacer?
(No quiero usar CSS)
resize(); function resize() { document.getElementById("can").style.width = window.innerWidth + "px"; document.getElementById("can").style.height = window.innerHeight + "px"; } body { margin: 0; padding: 0; } #can { margin: 0; padding: 0; background-color: #eee; } <body onresize="resize();"> <canvas id="can" /> </body>Necesitas agregar display: block; css a su lienzo.
resize(); function resize() { document.getElementById("can").style.width = window.innerWidth + "px"; document.getElementById("can").style.height = window.innerHeight + "px"; } window.addEventListener('resize', resize); body { margin: 0; padding: 0; } #can { display: block; margin: 0; padding: 0; background-color: #eee; } <canvas id="can" />