As a language for structuring and presenting content for the World Wide Web, HTML5 is becoming more and more popular. People are expecting creations that HTML5 can bring to us. HTML5 shadow covers a sub-section of what is possible, including HTML5 canvas shadow, HTML5 text shadow and HTML5 drop shadow. HTML5 shadow can be created in HTML5 <canvas>. To offset HTML5 shadows with the Canvas, we can use the shadowOffsetX and the shadowOffsetY properties of the canvas context.
In this post, I present you 12 tutorials of HTML5 shadow examples. Hope you will enjoy reading those HTML5 shadow code!
var canvas=document.getElementById("myCanvas"); var ctx=canvas.getContext("2d"); ctx.rect(20,20,100,80); ctx.fillStyle="red"; ctx.shadowColor="black"; ctx.shadowBlur=10; ctx.shadowOffsetY=30; ctx.fill();