javascript方法:
var oC=document.querySelectorAll(‘canvas‘)[0];
oC.width=document.documentElement.clientWidth;
oC.height=document.documentElement.clientHeight;
//oC.width=window.innerWidth;
//oC.height=window.innerHeight;
css方法:
html,body{width:100%;height:100%;margin:0;overflow:hidden;}
body{background:#000;}
canvas{background:#fff;height:100%;width:100%;}
作者:smile.轉角
QQ:493177502
原文:http://www.cnblogs.com/websmile/p/5292392.html