I’m using a css drop shadow technique found here:
http://nicolasgallagher.com/css-drop-shadows-without-images/demo/
It uses the psuedo classes, before and after, to give more shape to your shadows. The problem is that I can’t get the shadow to display over other elements.
Here is jsfiddle: http://jsfiddle.net/S7dzj/6/
I have tried various relative positioning of the div’s with different z-indexes.
I have also tried to move the header element within the top div, no help.
I have also tried moving the top div relatively top: -5px to make it go underneath the header div but still no shadow.
Is there a way to accomplish this?
The
z-indexproperty only applies to elements which are notposition: static, so your.topclass was merely ignoring that property.Your
.headerand.topclasses both had the samez-index, so the header was appearing on top.See the updated jsFiddle. All I did was add
position: relative(which doesn’t visually do anything on its own) to.topand change it’sz-indexto-2.