Why does adding a keyframe animation alter z-index?

Viewed 155

I have a scenario where I need to animate a div that has a children acting as background helpers. The children need to stay behind the div's background at all time. Without animation adding
z-index: -1 keeps them behind the tranparent background. However they do not stay behind the background when animating.

I have prepared a jsFiddle to show this:

-->https://jsfiddle.net/Jonathan002/gmv70wz7/6/

I know I can fix this by adding an extra div tag to be the background instead. I want to avoid this and direct the question on why the animation will alter my z-index values. Is there another property change happening when the div is animating?

How can I get the div to animate-in naturally (with no changes to dom) while retaining the z-index values?

1 Answers
Related