代码
<!DOCTYPE>
<html>
<head>
<title>无标题页</title>
</head>
<body>
<canvas id="myCanvas">
your browser does not support the canvas tag
</canvas>
<script type="text/javascript">
function drawCanvas()
{
var canvas=document.getElementById('myCanvas');
var ctx=canvas.getContext('2d');
ctx.fillStyle='#FF0000';
ctx.fillRect(0,0,80,100);
}
drawCanvas();
</script>
</body>
</html>
欢迎转载,转载请注明:转载自[ http://www.cnblogs.com/zjfree/ ]