<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no"/>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
html,body{
width: 100%;
height: 100%;
}
.box {
width: 100%;
height: 100%;
overflow: auto;
position: relative;
}
.content {
z-index: 1001;
}
.model {
width: 100px;
height: 100px;
background: #f99;
position: fixed;
top: 50%;
left: 50%;
margin-left: -50px;
margin-top: -50px;
z-index: 1003;
}
.shade {
width: 100%;
position: fixed;
background: #000;
opacity: 0.5;
z-index: 1002;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
</style>
</head>
<body>
<div class="box">
<div class="content">
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
<p>111</p>
</div>
<div class="model">
</div>
<div class="shade">
</div>
</div>
<script type="text/javascript">
</script>
</body>
</html>
遮罩层居中
猜你喜欢
转载自blog.csdn.net/boysky0015/article/details/78281799
今日推荐
周排行