JQ实现——TAB选项卡切换登录界面

今天,分享一个简单实用的TAB选项卡切换登录界面。
这里写图片描述
这里写图片描述

##主页部分

<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=Edge">
	<link rel="stylesheet" href="css/login.css">
	<title>Login</title>
</head>
<body>
	<div class="section">
		<div class="all">
			<div class="nav">
				<a class="login on">普通登陆</a>
				<a class="login">二维码登陆</a>
			</div>
			<div class="contentbox">
				<div class="box active">
					<div class="cont-1">
						<input class="icon email" name="txt" type="text" placeholder="邮箱">
						<input class="icon password" name="psd" type="password" placeholder="密码">
						<div class="verify">
							>>>请依次点击"敏""享""昔"完成验证>>>
						</div>
						<button class="btn">&nbsp;&nbsp;</button>
						<div class="about"><a href="#">忘记密码?&nbsp;&nbsp;<span></span>&nbsp;&nbsp;注册&nbsp;&nbsp;<span></span>&nbsp;&nbsp;关于网易邮箱帐号</a></div>
					</div>
				</div>
				<div class="box">
					<div class="cont-2">
						<span class="text">使用&nbsp;<a href="#">网易帐号管家</a>&nbsp;&nbsp;<a href="#">邮箱大师</a>&nbsp;扫一扫快速登陆</span>
						<img src="img/img2_01.png" width="190" height="190">
						<div class="about"><a href="#">忘记密码?&nbsp;&nbsp;<span></span>&nbsp;&nbsp;注册&nbsp;&nbsp;<span></span>&nbsp;&nbsp;关于网易邮箱帐号</a></div>
					</div>
				</div>
			</div>
		</div>
	</div>

	<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
	<script>
		$().ready(function(){
			$(function(){
				$(".nav a").off("click").on("click",function(){
					var index = $(this).index();
					$(this).addClass("on").siblings().removeClass("on");
					$(".contentbox .box").eq(index).addClass("active").siblings().removeClass("active");
				});
			});
		})
	</script>
	<!--[if lte IE 9]>
     <script src="https://cdn.bootcss.com/jquery-placeholder/2.3.1/jquery.placeholder.min.js"></script>
     <script>
        $(function(){
            $('input[placeholder]').placeholder();
            $('.password').css({"margin-top":"17px"})
        });
     </script>
    <![endif]-->
</body>
</html>

##样式部分

*{
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
.section{
	margin: 100px auto;
	width: 472px;
	height: 422px;
	background-color: #39a6eb;
	padding: 8px 10px;
	font-family: "Microsoft YaHei";
}
.all{
	width: 450px;
	height: 405px;
}
.nav{
	height: 50px;
}
.nav>a{
	padding: 0 15px;
	width: 225px;
	height: 50px;
	line-height: 50px;
	display: block;
	font-size: 18px;
	font-weight: bold;
	text-align: center;
	float: left;
	cursor: pointer;
}
.nav>a[class="on-2-login"]{
	background-color: #89caf4;
	border-bottom: 1px solid #eee;
}
.login{
	background-color: #89caf4;
}
.login.on{
	background-color: #e1f2fc;
}
.contentbox{
	width: 450px;
}
.cont-1>input{
	width: 350px;
	height: 46px;
	border: 1px solid #c6cddc;
}
.email{
	background-image: url("../img/img1-coin1_03.png");
	background-repeat: no-repeat;
	background-position: 3px 0px;
}
.password{
	background-image: url("../img/img1-coin2_03.png");
	background-repeat: no-repeat;
}
.cont-1>input{
	line-height: 46px;
	padding-left: 40px;
}
.cont-1>input[name="txt"]{
	margin-top: 35px;
}
.cont-1>input[name="psd"]{
	margin-top: 17px;
}
.verify{
	margin: 0 auto;
	width: 352px;
	height: 40px;
	margin-top: 16px;
	border: 1px solid #c4cbd1;
	text-align: center;
	line-height: 40px;
	font-size: 12px;
	color: #b9bbb8;
	border-radius: 20px;
	position: relative;
	z-index: 2;
	behavior: url(PIE.htc);
}
.verify:hover{
	cursor: pointer;
}
.btn{
	width: 350px;
	height: 44px;
	background-color: #39a6eb;
	margin-top: 30px;
	font-size: 18px;
	color: #fff;
}
.btn:hover{
	background-color: rgba(121,177,212,0.9);
}
.about{
	width: 350px;
	height: 26px;
	font-size: 14px;
	margin: 0 auto;
	margin-top: 46px;
}
.about>a{
	text-decoration: none;
	color: #4e6d99;
}
.about>a>span{
	width: 1px;
	height: 12px;
	display: inline-block;
	border: 1px solid #ccd2d0;
}
/*cont:2*/
.cont-2>.text{
	margin: 0 auto;
	width: 350px;
	height: 30px;
	font-size: 15px;
	display: inline-block;
	margin-top: 30px;
}
.cont-2>.text>a{
	text-decoration: none;
	color: #4174a9;
	font-weight: bold;
}
.cont-2>img{
	margin-top: 12px;
}
.contentbox>div{
	width: 450px;
	height: 355px;
	text-align: center;
	display: none;
	background-color: #e1f2fc;
}
.cont-2>.about{
	margin-top: 54px;
}
.contentbox>div[class="box active"]{
	display: block;
}
/*这是低端浏览器下placeholder的字体颜色*/
.cont-1>input{
    color: #bfbfbf;
}
/*这是firefox下placeholder的字体颜色*/
.cont-1>input::-moz-placeholder {
    color: #bfbfbf;
}
/*这是webkit下placeholder的字体颜色*/
.cont-1>input::-webkit-input-placeholder {
    color: #bfbfbf;
}
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

猫猫的小茶馆

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值