HTML Editor
<!DOCTYPE html> <html lang="en-US"> <body> <canvas id="myCanvas" width="200" height="200" style="border:2px solid;">Your browser does not support canvas tag. </canvas> <script> //Draw rectangle inside square var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); ctx.fillStyle = "#248f24"; ctx.fillRect(23, 50, 150, 100); </script> </body> </html>
OUTPUT
×

Save as Private