基本上,我正在寻找这样做,但这是行不通的。我如何才能获得所需的结果而不必将其移到DOM中的其他位置?
<div id="parent">
<div id="child">
</div>
</div>
#parent {
z-index: -1
}
#child {
z-index: 999999;
position: absolute
}
最佳答案
这里是:
#parent {
position: relative;
z-index: 1;
}
#child {
position: relative;
z-index: 5;
}
关于html - 使 child 的z索引比 parent 高,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/42473604/