Demo Fiddle
You need to give cover
a position
for z-index
to work, e.g.
.cover{z-index: 10;position:relative;}
The z-index CSS property specifies the z-order of an element and its descendants. When elements overlap, z-order determines which one covers the other. An element with a larger z-index generally covers an element with a lower one.
For a positioned box, the z-index property specifies:
- The stack level of the box in the current stacking context.
- Whether the box establishes a local stacking context.