I am trying to achieve an effect similar to the jsfiddle below. I would like to layer an HTML list in the opposite direction as it’s default.
The goal is to get the parent list elements to appear as if they are above the child list elements. In the fiddle there is margin top on the child element to better show the box shadow. My goal is to change the margin-top from 5px to -5px and have that child item appear below the parent.
Is this something that is achievable? I have tried some things with z index to no avail. I tried to use absolute positioning but that did not seem to work very well either.
Z-indexing will only work when you set the
positionproperty. Setting it torelativewill do in this case.See this Fiddle based on your code.
Note: I have set the margin to 0px instead of 5px, so the child tucks below the parent. I suggest you use
padding-topinstead ofmargin-topto get more spacing