Jump to content

z-index of img not working


VaporAction

Recommended Posts

I'm making a navigation bar at the top of the page that I want to remain fixed while the use scrolls down the page...I have no problems if I make the bar with HTML and CSS but when I tried to make the bar from an image it doesn't seem to work...specifically, the image doesn't seem to be taking the z-index that I give it so that when you scroll the rest of the page runs over top of it...I'm using Firefox so it has nothing to do with the various IE bugs...the CSS I'm using runs something like this.....navImage {position: fixed;z-index: 50;}the only other clue is that the content of the page is an embedded swf file...is there something about the z-index of swf files and images?

Link to comment
Share on other sites

You only have one problem, its very common. I used to do it actually.. To use z-index you have to have position: absolute;. Nothing else will work with it.
nope, position: fixed works with z-index as well...I set the wmode="transparent" for the swf file and that works BUT ONLY if there arent' any images in the nav bar...if there's images then the swf file still overlaps, although it's tranparent...is there something about images creating some sort of weakness in the z-index?
Link to comment
Share on other sites

What if it had something to do with images being inline elements? Perhaps position: fixed; only works right with block level elements. You might try chaging your CSS so that the image has:

.navImage {display: block;position: fixed;z-index: 50;}

Link to comment
Share on other sites

What if it had something to do with images being inline elements? Perhaps position: fixed; only works right with block level elements. You might try chaging your CSS so that the image has:
.navImage {display: block;position: fixed;z-index: 50;}

tried that, didn't work...I have the img inside a div anyway which displays as a block anyway, I think?
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...