I'm coding a "popup window" in JavaScript and I've come across an interesting thing:
The navy square under the popup window is visible even though I would expect it to be hidden. The popup was added after the square, so it should be on the top.
CSS opacity
property of the navy square is 0.3
. From what I've tried, it seems that every number from the interval (0,1)
would yield the same result. If I change it to 1
, then it behaves as expected (i.e. the part of the square under the popup is hidden).
I've tried to set the z-index
property to 10
for the square and 100
for the popup, but it doesn't change anything.
What am I missing? Why is part of square displayed?
Tested browsers:
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…