尝试了很多遍,依然不知道问题在哪,即使是写和别人一样的代码,也没有图形出来。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
canvas{border: 2px solid red;}
</style>
</head>
<body>
<canvas id="canvas" width="500" height="500"></canvas>
<script type="text/javascript">
var c = document.getElementById("canvas");
var context=c.getContext("2d");
context.arc(200,200,100,0,Math.PI*2)
context.closePath();
context.fillStyle="black";
context.fill=();
context.beginPath();
context.arc(200,200,100,1.5,Math.PI*1.5,true)
context.closePath();
context.fillStyle="white";
context.fill=();
context.beginPath();
context.arc(201,150,50,1.5,Math.PI*1.5,false)
context.closePath();
context.fillStyle="white";
context.fill=();
context.beginPath();
context.arc(200,250,50,1.5,Math.PI*1.5,true)
context.closePath();
context.fillStyle="black";
context.fill=();
</script>
</body>
</html>
```
你的代码什么的都没有,你让人怎么回答你