如何用css3在span上画两个圆
展开全部
<!DOCTYPE html>
<html>
<head>
<title>circle</title>
<style>
* {
margin:0px;
}
</style>
</head>
<body>
<span>
<canvas id="Canvas" width="200" height="100" style="border:1px solid #000000;"></canvas>
</span>
<script>
var c = document.getElementById("Canvas");
var ctx = c.getContext("2d");
ctx.beginPath();
ctx.arc(55, 40, 40, 0, 2 * Math.PI);
//x,y,r,2π
ctx.stroke();
ctx.beginPath();
ctx.arc(155, 40, 40, 0, 2 * Math.PI);
//x,y,r,2π
ctx.stroke();
</script>
</body>
</html>
<html>
<head>
<title>circle</title>
<style>
* {
margin:0px;
}
</style>
</head>
<body>
<span>
<canvas id="Canvas" width="200" height="100" style="border:1px solid #000000;"></canvas>
</span>
<script>
var c = document.getElementById("Canvas");
var ctx = c.getContext("2d");
ctx.beginPath();
ctx.arc(55, 40, 40, 0, 2 * Math.PI);
//x,y,r,2π
ctx.stroke();
ctx.beginPath();
ctx.arc(155, 40, 40, 0, 2 * Math.PI);
//x,y,r,2π
ctx.stroke();
</script>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询