Forums

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

Home Forums CSS z-index question

  • This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #35902
    Arvid
    Member

    I’m trying to place an element behind its parent container using z-index. The parent is positioned relative and the child element absolutely. The child elemment is a nav containing a ul with li’s in it. Each li contains a link. I’ve set the z-index of the parent to be higher than the z-index of the nav, and I am clueless as to why the nav continues to be placed on top of its parent div. I’d really apreciate any help, thanks!

    #93739
    Mottie
    Member

    Did you try setting the nav z-index to a negative number? If you are still having issues, please share a demo of the problem on jsFiddle.net.

    #93740
    Arvid
    Member

    I did. The nav is negative z-index and its container has a positive value.

    Here’s a link: http://dabblet.com/gist/1542051

    Thank you for the quick reply, I’m sure I’m missing something obvious.

    #93743
    Mottie
    Member

    Oh, remove the “z-index: 10;” from the “.wrapper”.

    #93744
    Arvid
    Member

    Thanks a lot! May I ask why it works like that?

    #93745
    Arvid
    Member

    Oh and how would I make it clickable and hoverable again, when it’s outside of the container?

    #93753

    Inheritance

    #93757
    Arvid
    Member

    Care to elaborate? Love the name btw

    #93764
    Anonymous
    Inactive

    Z-index is the CSS property that defines the stack order of any element. Element with greater stack order is placed in front of element with lower stack order.

    VPN

    #93784
    Arvid
    Member

    Yes, but how would I make thee element with the lower z-index hover/clickable if it’s visible outside it’s continer?

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