我想处理一些东西而且我使用叠加来加载,一切正常,直到我使用模态,当我处理某些内容并调用叠加层来加载它时总是在模态的后面,我该怎么称呼莫代尔前面的叠加?
以下用于叠加的CSS。
img#loading {
position: absolute;
z-index: 1;
left: 45%;
top: 30%;
width: 150px;
}
.overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
background-color: rgba(0,0,0,0.5); /*dim the background*/
}
答案 0 :(得分:0)
试试这个:
HTML:
<div id="myModal" class="modal">
<!-- Modal content -->
<div class="modal-content">
<div class="overlay">
<span class="close">×</span>
<p>Some text in the Modal..</p>
</div>
</div>
</div>
CSS:
.modal-content{
position: relative;
}