The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] How can I cross-manipulate z-index?

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #149343

    Is it possible to put an element within the header BELOW an element from the body?

    Whenever I try to set the z-index of the header element to 0 and the z-index of the body element to 1, it doesn’t work.

    What am I missing?


    Could you put something in Codepen…and perhaps explain what you are trying to do?

    Why would anything be below the body….it’s, effectively, the page container so everything else will be inside it?


    Yes. I see what you mean and I agree…it’s sketchy :)

    I’m assuming those big images aren’t content as such…my gut instinct is to do something with background images but if they are going to be content then that’s out.

    Hmmm…I’ll have to think.


    I’m sure I’ve seen a menu system like that before…


    A quick search and on our very own Codepen

    It’s not the one I was thinking of and it doesn’t solve the header issue… but perhaps we’re overthinking that.

    We could just add a bar to the first image and position the header accordingly.


    I haven’t had time to look at this in detail yet but I’m thinking that a pseudo element might work in place of an actual HTML element.

    Sometimes though…you just have to deal with slightly sneaky source code to get what you want….if some random developer does decide to inspect it (unlikely) and doesn’t like it…so what, it works.

    Sometime you just have to do what you have to do.


    BTW….I realise that this is just a single full page site at the moment but were you thinking of a fixed menu at the top of the page?


    As long as the both elements are positioned either absolute or relative, it shouldn’t matter that their not in the same div or container.

    Not strictly true but i get what you are saying.

    Perhaps slowly rebuilding the page adding each element at a time with the proper z-index stacking might be an option.

    Make sure each element is positioned and increment the z-index values in lots of say 10.

    I won’t be able to work on this until I get back to my desktop tomorrow but I’m sure this is doable.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.