【发布时间】:2020-09-24 17:57:01
【问题描述】:
我有一个水平列表框,它被弹出叠加层重叠。并且水平框是使用ui li构造的
现在的问题是,如何使用z-index 获得叠加层上方的单个框。在我的示例中,我需要在覆盖 div 上方获取类名 .test 的 li。
.wrapper { position: relative }
ul li {
margin:0;
padding:0
}
li {
background:yellow;
display:inline-block;
width:60px;
height: 60px;
}
.overlay {
background: rgba(0,0,0,0.5);
position: fixed;
top:0;
left:0;
width:100%;
height:100%;
z-index:10
}
.test {
z-index:100 /*not working */
}
【问题讨论】:
标签: html css css-position z-index