608636-1-ref.html (633B)
1 <!DOCTYPE HTML> 2 <html style="background:white"> 3 <body> 4 <canvas id="b" style="position:absolute; left:0; top:0" width="20" height="20"></canvas> 5 <div style="position:absolute; left:0; top:0; transform:rotate(45deg); height:400px; width:400px; opacity:0.5; border:1px solid black;"></div> 6 <div style="position:absolute; left:-3px; top:-3px; transform:rotate(45deg); height:390px; width:390px; border:10px solid red;"></div> 7 <script> 8 function fillCanvas(id) { 9 var ctx = document.getElementById(id).getContext("2d"); 10 ctx.fillStyle = "black"; 11 ctx.fillRect(0, 0, 10, 10); 12 } 13 fillCanvas("b"); 14 </script> 15 </body> 16 </html>