jQuery实现蒙版登陆窗口

<!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>

网页内容部分补充上自己的网页内容就可以啦

在这里插入图片描述
点击登录后
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值