标签:style blog ar io color os sp java on
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Canvas</title> </head> <style type="text/css"> </style> <script type="text/javascript"> function $$(id){ return document.getElementById(id); } function pageLoad(){ var can = $$(‘can‘); var cans = can.getContext(‘2d‘); var jindu = 2; cans.beginPath(); cans.arc(60,60,50,0,jindu*Math.PI,false); cans.strokeStyle = ‘#00aae8‘; cans.lineWidth = 15; cans.stroke(); cans.closePath(); } </script> <body onload="pageLoad();"> <div style="position: relative;"> <canvas id="can" width="120px" height="60px"></canvas> <div style="position: absolute;top: 32px;left: 41px;font-size: 21px;font-family: ‘微软雅黑‘;">50%</div> </div> </body> </html>
标签:style blog ar io color os sp java on
原文地址:http://www.cnblogs.com/shcolo/p/4168690.html