Q
Why might z-index: 999 have no effect on an element?
-
A
The maximum value is 100
-
B
z-index applies only to positioned elements (and flex or grid items); a static element ignores it
-
C
z-index works only on images
-
D
It needs !important
Correct Answer:
B. z-index applies only to positioned elements (and flex or grid items); a static element ignores it
Explanation:
Stacking contexts created by ancestors also limit the effect of z-index.