使画布填满整个页面 [英] Make canvas fill the whole page
本文介绍了使画布填满整个页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使画布的宽度和高度为100%?
How can I make canvas be 100% in width and height of the page?
推荐答案
: Google的Bouncing Balls HTML5?使用以下CSS:
* { margin: 0; padding: 0;}
body, html { height:100%; }
#c {
position:absolute;
width:100%;
height:100%;
}
其中#c是canvas元素的ID。
Where #c is the id of the canvas element.
这篇关于使画布填满整个页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文