I'm trying to get the .activetri class to position its background at the very top of the stack order as to show the active page the user is one. However, the .Imgheader class wont z-index underneath it.
Ive tried ordering the divs with a stack order - doesnt work
Ive tried doing a negative z index like here;
Positioned elements paint on top of everything else if they don't have negative z-index. This means everything, including floats. This can be quite useful if, for example, you want something to paint on top of everything else, but you want a child of that item to be behind everything else. For that, you can position that element relative, with no z-index, and then position the child with a negative z-index. The first rule would paint the overlapping item above floats etc., while not creating a new stacking context. The second rule would push the child behind everything else.
Any ideas on how i can accomplish this, the funny thing is i made it work on firebug with the negative z-index trick but when i implemented; it didn't work. Thanks for the advice
Well, technically, what I would've done, to make it semantic, is to just use the "active" class on the current LI item in the nav to have a background image and then set the z-index of the nav higher than the z-index of the header.
I've switched careers...
I'm NO LONGER a scientist,
but now a web developer...
awesome.
Well, technically, what I would've done, to make it semantic, is to just use the "active" class on the current LI item in the nav to have a background image and then set the z-index of the nav higher than the z-index of the header.
Yes thats how i originally would have coded it myself. but unfortunately the client kept changing her mind. so the HTML isn't as semantic as it could have been!
so would changing the Imgheader class to a DIV and not the IMG, then have the image nested inside, would that do the trick ?
thanks for your input sir, i recognize that there are plenty of ways to achieve the result more semantically but i need to getting working with the least amount of edits.
Yes. Both images have to be positioned (position: relative) and the image that was the background image has a higher z-index than the header image.
Again, terrible way to do it because any img's that you have in your code should be relevant to your content (and thus add some SEO value), if not, then they should be, as you made it the first time, a background image. But I guess my stance on that has already been clear.
I've switched careers...
I'm NO LONGER a scientist,
but now a web developer...
awesome.
You can't have a child element appear BENEATH the BACKGROUND of it's parent. Ever. Which is what you are trying to do.
I guess I should amend that so it says 'ancestors' instead of parent. Same rules apply - you cannot have a child element appear BENEATH a BACKGROUND image/color/gradient of any of it's ancestors. We'll call the background element the z-index limit - if an element has a background, every descendent element will ALWAYS appear above the background.
You're z-index rules aren't making any sense.
This is what I was referring to that you COULD do (although I highly discourage it)
That way you have elements positioned - the first absolutely so it doesn't interfere with where you ImgHeader falls in your document - and you are using z-indicies that have relevance to each other because they are on sibling, positioned elements.
I've switched careers...
I'm NO LONGER a scientist,
but now a web developer...
awesome.
Bookmarks