This is impossible as a child's z-index
is set to the same stacking index as its parent.
You have already solved the problem by removing the z-index from the parent, keep it like this or make the element a sibling instead of a child.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…