Toggle navigation
☰
HTML
CSS
Scripting
Database
<!DOCTYPE html> <html> <body> <canvas id="shadowCanvas" width="300" height="150" style="border:1px solid #d3d3d3;"></canvas> <script> var canvas = document.getElementById("shadowCanvas"); var ctx = canvas.getContext("2d"); // Setting shadow properties ctx.shadowBlur = 10; ctx.shadowColor = "rgba(0, 0, 0, 0.5)"; ctx.shadowOffsetX = 8; ctx.shadowOffsetY = 8; // Drawing a filled rectangle with shadow ctx.fillStyle = "#FF8C00"; ctx.fillRect(50, 25, 100, 100); // Drawing another shape with shadow ctx.shadowColor = "#0070C0"; ctx.beginPath(); ctx.arc(220, 75, 40, 0, Math.PI * 2); ctx.fill(); </script> </body> </html>