Toggle navigation
☰
HTML
CSS
Scripting
Database
<!DOCTYPE html> <html> <body> <canvas id="pathCanvas" width="300" height="150" style="border:1px solid #d3d3d3;"></canvas> <script> var canvas = document.getElementById("pathCanvas"); var ctx = canvas.getContext("2d"); // Draw a triangle ctx.beginPath(); ctx.moveTo(50, 50); ctx.lineTo(150, 50); ctx.lineTo(100, 130); ctx.closePath(); // Outline the triangle ctx.strokeStyle = "#FF8C00"; ctx.lineWidth = 5; ctx.stroke(); // Fill the triangle ctx.fillStyle = "#0070C0"; ctx.fill(); </script> </body> </html>