I’m trying to fade a DIV inside a <canvas> tag. (is that even allowed? I assume so since it’s an element). You know the standard jQuery fadeIn and here is what I use for style:
<style type="text/css">
<!--
#canvas {
background:red;
z-index:0;
position:relative;
}
.txt {
z-index:2;
background:blue;
display:none;
position:absolute;
top:0;
right:0;
width:200px;
}
-->
</style>
and simply enough here is my HTML (ignore the body.. I have it all.. this is to cut it short):
<body>
<canvas id="canvas"><div class="txt">Welcome to the Game</div></canvas>
</body>
I tried a simple fadein and it’s not working..
From the WHATWG spec:
“Fallback content” is displayed only when the browser does not support a type of element:
You should put the div after the canvas element and use CSS to position it visually over the canvas.