I found similar topics but they all used absolute positioning which placed the canvases at the top left of the page. I have them contained within a div but I'm not sure exactly how to get them to layer properly. I tried using absolute and relative positioning in CSS but I wasn't having any luck.
Do this:
<style>
#container { position: relative; }
.canvas { position: absolute; top: 0; left: 0; }
</style>
<div id="container">
<canvas class="canvas" id="canvas1"></canvas>
<canvas class="canvas" id="canvas2"></canvas>
</div>
Make sure to add position: relative to the containing div in order to position the canvas elements absolutely within it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With