Prev Demo
Gradient Text
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Gradient text</title> </head> <body> <canvas id="myCanvas" width="300" height="300"></canvas> <script> var canvas = document.getElementById("myCanvas"); var ctx = canvas.getContext('2d'); ctx.shadowColor = "rgb(29, 289, 10)"; ctx.shadowOffsetX = 20; ctx.shadowOffsetY = 20 ctx.shadowBlur = 10; ctx.font = "50px arial"; var gradient = ctx.createLinearGradient(0, 0, 150, 100); gradient.addColorStop(1, "rgb(255, 10, 18)"); gradient.addColorStop(0, "rgb(55, 53, 151)"); ctx.fillStyle = gradient; ctx.fillText("TechFunda", 10, 50); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output