<canvas id="me"></canvas>//申请一个canvas标签
<script>
var canvas = document.getElementById("me");//脚本控制
var can = canvas.getContext("2d");
can.fillStyle = "#FF000";
can.fillRect(0, 0, 80, 1000);
</script>
原文:http://www.cnblogs.com/zhuzhuer/p/5927944.html