我有一个暗淡的叠加层,并希望某些元素能够穿透。似乎更高的 z-index 是不够的:我必须设置 position: relative/absolute
。有什么办法可以避免这种情况吗?在这里查看我的基本示例:http://jsfiddle.net/hSYU2/ .一旦您删除 position
,圆圈就会消失。
对机制的解释会很丰富。
最佳答案
来自 CSS2 specification ,
'z-index' Value: auto | <integer> | inherit Initial: auto Applies to: positioned elements
z-index
仅适用于定位元素(即:固定的、绝对的或相对的),所以不,没有办法避免它。
关于CSS 昏暗覆盖 : Shining through,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6754947/