<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
html,body{
height: 100%;
width: 100%;
}
.mask{
height: 100%;
width: 100%;
position: fixed;
background-color: rgba(0,0,0,0.5);
top:0;
left: 0;
}
.mask>.login{
margin: 50px auto;
width: 500px;
height: 290px;
position: relative;
background-color: white;
}
.login>span{
text-align: center;
display: block;
padding-top: 20px;
padding-bottom: 40px;
font-size: 20px;
font-family: "微软雅黑";
color: cornflowerblue;
}
input{
width: 350px;
height: 25px;
margin-left:20px ;
margin-bottom: 20px;
}
label{
margin-left:50px ;
}
.login>button{
margin-top:20px;
margin-left: 150px;
margin-right: -100px;
font-size: 16px;
color: black;
background-color: cornflowerblue;
opacity: 0.5;
border-style: solid;
border-color: aliceblue;
height: 40px;
width: 80px;
border-radius: 5px;
}
</style>
<script src="js/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#login").click(function(){
$(".mask").css("display","");
});
$("#in").click(function(){
$(".mask").css("display","none");
});
$("#out").click(function(){
$(".mask").css("display","none");
});
})
</script>
<body>
<div class="mask" style="display: none;">
<div class="login">
<span>登录</span>
<label for="id">账号</label>
<input type="text" id="id" />
<label for="password">密码</label>
<input type="password" id="password" />
<button type="button" id="in">登录</button>
<button type="button" id="out">取消</button>
</div>
</div>
<div class="content">
<button id="login">登录</button>
<p>
网页内容
</p>
</div>
</body>
</html>
网页内容部分补充上自己的网页内容就可以啦
点击登录后