Log in

View Full Version : not getting box-shadow effect



gib65
11-06-2017, 11:42 PM
Hello,

I have a div with a box-shadow:

6223

However, if I scroll the list until a highlighted item is under the box-shadow, no box-shadow shows up.

6224

The only difference between the highlighted and unhighlighted items is that the highlighted item has this CSS:

background: #f6f6f6;

Why would setting the background color on the highlighted item remove the box-shadow effect?

molendijk
11-08-2017, 02:22 PM
It has to do with z-index, see this (https://stackoverflow.com/questions/10587814/css-why-background-color-breaks-removes-the-box-shadow).

gib65
11-08-2017, 04:58 PM
Well, here's the strange thing:

I deliberately set the z-index of the div with the box-shadow to 100. All other divs in the list below it do not have their z-index set.

Yet when I inspect the elements, I find that the z-index of the div with the box-shadow has been set to auto, and that all divs in the list have their z-index set to auto.

Why would the z-index of my box-shadow div get set to auto?

molendijk
11-08-2017, 06:12 PM
Can you give us your code, or a working example?