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;结果是这样的:按道理不应该 canvas 和 body 一样高吗?为什么 body 会多出来4个像素呢?请教大家,谢谢!
添加回答
举报
0/150
提交
取消