弹出框,先弹出遮罩有透明度灰色100%高宽,置顶z-index:999---再弹出框最顶部z-index:9999

时间:2021-09-07 05:11:32

<div class="mask"></div>
<div class="maskbox">

<form id="addMester" action="">

</form>

</div>

//01先添加遮罩mask类,height:100% width:100% background:#ccc  opacity:0.7 z-index:999

//02再添加弹出框maskbox类 z-index:9999

.mask{ display: inline-block;

height: 100%;

width:100%;

z-index: 999;

background: #ccc;opacity: 0.7;position: absolute;top: 0;right: 0; box-sizing:border-box; -webkit-user-select:none; display: none;}

.maskbox{

width: 90%;

height:230px;

background: #ffffff;

border-radius: 10px;margin: 2% 5%;

z-index: 9999;

box-sizing:border-box;position: absolute;top: 0;right: 0; margin-top: -500px;}