【发布时间】:2018-02-03 23:20:21
【问题描述】:
我有一个覆盖,我想显示一些信息。但是,我想在叠加层下方显示一个按钮。我已将叠加层的 z-index 设置为 9998,并将其下方的按钮设置为 z-index 9999,但它不起作用。这可能吗?
.overlay-message {
position: fixed;
top: 0;
left: 0;
height: 100%;
width: 100%;
display: table;
background-color: rgb(0, 0, 0);
opacity: .9;
z-index: 9998;
}
h4 { display: table-cell;
color: #fff;text-align: center;
vertical-align: middle; }
.container {
align-items: center;
width: 100%;
max-width: 100%;
height: 100%;
}
.row {
display: table !important;
align-items: center;
justify-content: center;
}
.one-fifth-flex {
width: 50%;
padding-bottom: 20px;
float: left;
}
.ico-btn {
background-color:transparent;
color:rgb(26, 188, 156);
border-color:rgb(26, 188, 156);
border-style: solid;
border-width: 10px;
width:100px;
z-index: 9999;
}
<div class="overlay-message">
<h4>Hey! Tap on the button above!</h4>
</div>
<div class="container">
<div class="row">
<div class="one-fifth-flex">
<div role="button" class="ico-btn">
Me
</div>
</div>
</div>
</div>
【问题讨论】:
-
我看到很多 flex 属性,但没有
display: flex... 如果没有这些,它们将无法工作