admin管理员组文章数量:1332896
Can an HTML canvas tag be positioned over other html content on a page? For example, will something the following CSS declaration make a canvas tag do what I expect it to?
canvas.mycanvas {
position: absolute;
background: transparent;
z-index: 10;
top: 10px; left: 10px;
}
Can an HTML canvas tag be positioned over other html content on a page? For example, will something the following CSS declaration make a canvas tag do what I expect it to?
canvas.mycanvas {
position: absolute;
background: transparent;
z-index: 10;
top: 10px; left: 10px;
}
Share
Improve this question
asked Feb 19, 2009 at 17:11
DevonDevon
5,7845 gold badges40 silver badges46 bronze badges
3 Answers
Reset to default 5That should work perfectly. There's no need to set the background to 'transparent' though.
Overlaying a canvas is how this bookmarklet works.
Yes, this works fine in canvas-supporting browsers, and furthermore works equally as well in IE6 and IE7 using the exCanvas project which translate canvas mands into Microsoft's XML-based vector language, VML.
One thing I noticed when attempting to overlay canvas elements across-browsers is that you have to be especially careful with the order in which you append and subsequently access any canvas child DOM nodes. IE needs the item to be appended before you can work with it.
have you tried it? is it not working? i would say that the canvas tag would act as any other tag and be positioned aproprietly. if you want an easy way to test it in firefox, go here http://www.w3schools./tags/tryit.asp?filename=tryhtml5_canvas
本文标签: javascriptCan canvas tag be used to draw on top of other items on a pageStack Overflow
版权声明:本文标题:javascript - Can canvas tag be used to draw on top of other items on a page? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742303269a2449413.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论