css:
html,body {
margin: 0;
padding: 0;
}
canvas {
margin: 0;
padding: 0;
}
html:
<canvas id="canvas"></canvas>
javascript:
dt = document.getElementById('canvas');
dt.width = window.innerWidth;
dt.height = window.innerHeight;
The result is like this:
Logically shouldn’t canvas be as high as body? Why does body have 4 extra pixels?
Please tell me, thank you!
Add
to bodyPlease see: http://www.w3cplus.com/css/fi...