Every time I try to use z-index on a web page to change the stacking order of overlapping divs, I seem to run into a problem when a div, which is forced to decrease, becomes immune to mouse events.
In my current situation, I:
<div class="leftcolumn"> <div class="leftbar"></div> ... <h3>header</h3>
By default, h3 is not displayed - it is hidden behind the left panel. If I add z-index: 5; to h3 it is not displayed yet.
So, I add z-index: -1 to the left. Now it is hidden behind the left column - but at least h3 shows.
So, I am adding z-index: -2 to the left column. Now everything looks right - but you cannot click on anything in the left column. The mouse cursor does not change from the arrow.
I get this exact behavior in both Chrome and Firefox. IE7 doesn't display the left pane at all, but at least the stuff can be clicked.
So, do I misunderstand z-index, or is there an error here in both FF and Chrome? Can z-index be used effectively for this kind of thing, or do I need to find another way?
(I can change the HTML, but the less the better.)
Steve Bennett ㄹ
source share