Perhaps I am doing something wrong.
To my knowledge, if a parent div has a relative
position, a transparent color and a z-index of 1
, it should be above its child elements that have relative
position and the z-index of 0
.
One thing to add is that my parent container has the overflow set to auto
.
I have a parent Div element and two Divs nested inside:
My intention is to create a vertical scroll shadow using background gradient on the parent Div with background-attachment: local, local, scroll, scroll;
I have it working nicely, but the scroll shadow is showing up below the nested Divs, while it should be shown above.
Changing the z-index values of the parent and the child Div elements is not returning the desired result. Am I doing something wrong, or the Div elements are not behaving like expected in HTML?
Thanks!