z-index:20 appears under the z-index:10 even if its z index bigger
i am trying to make a lightbulb. here is codes JSfiddle
in my mind when i hit
#add must be appear on top of
#black because of its z-index(20) bigger than
#black (10). but it appears under the
#black. thanks for helping.
It’s because the
z-index property only applies to positioned elements.
The default value for the
position property is
static. If you added
position: relative to that element, it would work as expected.