Possible Duplicate:
Css z-index problem
I have an issue where one image is infront of another and z-index doesnt seem to change it. I am trying to make it so the logo is on top of the gray bars image.
Can anyone explain to me why this is not working?
see here i have change here... -remove img tag for bar image and put background of header tag.. :) -here i think you no need for position property and z-index.. :)
z-index
only works withposition : relative/absolute/fixed
so giveposition:relative
to your logo.http://jsfiddle.net/vzPUw/1/
Updated
http://jsfiddle.net/vzPUw/3/
In this, I changed in the markup because we never put
block
element inside aninline
element.<a>
is aninline
element &h1
is ablock
element.z-index:0;
isn't a good value to use. You should use 1 as a minimum. 1 is the window base. 0 is technically below the window.You simply need to call the right element (the anchor not the image within it) since the anchor is the container. Then it's a matter of margins and position for placement.
jsFiddle Here