[英]How to place Popup over overlay
這是我的 html 代碼:
<html lang="fr">
<head>
<link rel="stylesheet" type="text/css" href="./index.css">
</head>
<body>
<div id="main">
<div id="overlay"></div>
<popup></popup>
</div>
<script type="text/javascript" src="./vue.js"></script>
<script type="text/javascript" src="./vue-resource.min.js"></script>
<script type="text/javascript" src="index.js"></script>
</body>
</html>
和 css 代碼:
#overlay {
position: fixed;
display: block;
width: 100%;
height: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0,0,0,0.5);
z-index: 2;
cursor: pointer;
}
#popup {
position: fixed;
left: 33%;
right: 33%;
width: 30%;
height: auto;
padding: 1%;
}
添加z-index
以指定堆棧順序。
#overlay {
position: fixed;
display: block;
width: 100%;
height: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0,0,0,0.5);
z-index: 2;
cursor: pointer;
}
#popup {
position: fixed;
left: 33%;
right: 33%;
width: 30%;
height: auto;
padding: 1%;
z-index: 3;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.