Try also using position: absolute; instead of relative for both elements when using the z-index. It can then do some distortion in your layout, so you can put the div div in another relative div or use some other method to fix it, however it should work when using absolute position and z-index. If it still doesn't work, check to see if any of your javascript or any other elements in your code have a z-index, so it causes problems.
If absolute position is used, be sure to define margin-left and margin-top .
source share