Jump to content
Sign in to follow this  
shadowayex

Z-Index with nested ULs

Recommended Posts

In the normal scheme of things, if a parent UL and a nested UL would overlap, the nested one would be rendered on top of the parent one (or so I've gathered from testing and readings). I want the opposite effect; I would like parent ULs to render over child ULs in a project I've begun recently. I tried setting z-indices on all of the ULs and LIs in the structure, setting the largest z-index on the root UL and working down to the last LI in the structure, but that did not seem to affect what order the ULs were rendered on one another (although the LIs now behave as desired; the first on top, the second under the first, etc.). Is there any way to break out of the nested UL being rendered on top norm and get parent ULs to be rendered on top of their children ULs?

Share this post


Link to post
Share on other sites

The z-index of a child is always relative to its parent. That means that if the z-index is positive, it will be above the parent. It it's negative, the element will be below its parent. Use negative z.index values to achieve your goal.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...