user3057219
user3057219

Reputation: 1

HTML5, canvas over all elements

I have the following code:

<html>
<head>
<title>convas</title>
</head>

<body>

<canvas width="1745" height="569" style="width: 1730px; height: 1680px; position: absolute; z-index: 1"></canvas>

<div id="container">
html elemets (buttons, links)
</div>

</body>
</html>

The canvas is over the div element, but any buttons or links do not works.


Please check my example:

http://jsfiddle.net/58WC6/2/

It needs to work the image link with the falling snow over it.

Upvotes: 0

Views: 644

Answers (1)

LiamB
LiamB

Reputation: 18596

I'm assuming you want to sit the Container over the Canvas?

http://jsbin.com/eNUdUvAg/4/

Float the container and set the Z-Index.

<canvas width="1745" height="569" style="width: 1730px; height: 1680px; position: absolute; z-index: -1; background-color:red;"></canvas>

  <div id="container" style="z-index:99 float:left;">
  <button />

Upvotes: 1

Related Questions