W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <body> <canvas id="myCanvas" width="200" height="200" style="border:1px solid"> Your browser does not support the canvas element. </canvas> <script type="text/javascript"> var c=document.getElementById("myCanvas"); var cxt=c.getContext("2d"); cxt.fillStyle="#92B901"; cxt.fillRect(50,50,100,100); </script> </body> </html>