Reputation: 101
I'm triyng to stack 2 canvas elements on Wordpress site. Problem is that canvas elements refuse to stack.
Link to actual page: WebPage
CSS:
#plane{
position:relative;
z-index: 110;
border: 1px solid black;
width: 100%;
}
#plane1{
position:relative;
z-index: 120;
border: 1px solid black;
width: 100%;
}
was using clear:both;
, left: 0px;
, top: 0px;
but it didn't make any difference. The only way to shift second canvas to the top is to add top: -200px;
but top: -100%
dose not work :-[[[
Need help with this.
Upvotes: 0
Views: 63
Reputation:
You can try this:
position:relative;
onposition:absolute;
for both the canvas elements inside that div elementleft:0;top:0;
(unit not needed when 0) to adjust the position for the canvases if necessaryUsing relative on parent element makes the absolute positioned elements inside it relative to it. If you use relative on both you would need to adjust the position for one of them (as you already discovered).
Upvotes: 1