Jump to content

Z-Index with nested ULs


shadowayex

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?

Link to comment
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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...