随笔 - 317, 文章 - 0, 评论 - 453, 阅读 - 114万
  博客园  :: 首页  :: 新随笔  :: 订阅 订阅  :: 管理

第一个canvas

Posted on   PHP-张工  阅读(303)  评论(0编辑  收藏  举报

your browser does not support the canvas tag

代码

复制代码
<!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>
复制代码



努力加载评论中...
点击右上角即可分享
微信分享提示