Can I put a html button inside the canvas?
Given that the canvas element has a transparent content model, it may contain fallback elements which are displayed in the event that the canvas
element is unsupported. They will not be displayed if the canvas is supported.
If you display a list of controls in a menu element, you can position the menu relative to the canvas’ parent, and have the buttons “hovering” over the canvas:
<div id="container">
<canvas id="viewport">
</canvas>
<menu id="controls">
</menu>
</div>
CSS:
#container
{
height: 400px;
position: relative;
width: 400px;
}
#viewport
{
height: 100%;
width: 100%;
}
#controls
{
bottom: 0;
left: 0;
position: absolute;
width: 100%;
}