|
1 <!doctype html> |
|
2 <html> |
|
3 <head> |
|
4 <style type="text/css"> |
|
5 #one { |
|
6 position:absolute; |
|
7 left:0px; top:0px; |
|
8 z-index:1; |
|
9 } |
|
10 #two { |
|
11 position:absolute; |
|
12 top:100px; left:100px; |
|
13 // Set these using the canvas API |
|
14 // width:200px; height:200px; |
|
15 // background-color: rgb(255,0,0); |
|
16 z-index:0; |
|
17 } |
|
18 </style> |
|
19 <script type="text/javascript"> |
|
20 function paintCanvas() { |
|
21 var canvas = document.getElementById("two"); |
|
22 var ctx = canvas.getContext("2d"); |
|
23 ctx.fillStyle = "rgb(255,0,0)"; |
|
24 ctx.fillRect(0,0, 200,200); |
|
25 } |
|
26 </script> |
|
27 </style> |
|
28 </head> |
|
29 <body onload="paintCanvas();"> |
|
30 <canvas width="200" height="200" id="two"></canvas> |
|
31 <embed id="one" type="application/x-test" width="400" height="400" drawmode="solid" color="9900FF00"></embed> |
|
32 </body> |
|
33 </html> |
|
34 |