views:

17

answers:

1

I have 3 divs, each with a z-index higher than the previous and all overlain on eachother.

The bottom div has an image, the next div has a background-color with opacity:0.7 and the topmost div has another image. The problem is the top-most image also appears underneath the background-color of the div beneath it, in Chrome, FF and IE.

Is there a workaround to allow the top most image be displayed on top as it should?

A: 

I guess I could just replace the background-color with a plain img.

rutherford
hmm, this didn't work until I changed to position:fixed for the topmost div. Curious.
rutherford
actually not curious - I just found out for z-index to function properly it requires the position rule to be explicitly set in css.
rutherford
If you use fixed, then when the page scrolls, that element will be at the same place (ie, it won't scroll with the rest of the page). Position: static; is the default value.
Justus Romijn