HTML写一个登录框样式

以QQ空间的登陆框为例,原先的代码很复杂,还涉及了其他的知识,对于刚刚接触的人来说想写一点点样式来练练手的话可以看一下。
写好之后是这个样子
样式一样,但写法很多,只是一种而已
下面是代码

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<style type="text/css">
			body{
				background-color: gray;
			}
			.wrap{
				width: 414px;
				height: 312px;
				border: solid rgb(238,238,238) 2px;
				background-color: white;
				/*margin: 0px auto;*/
			}
			.wrap .title{
				margin-top: 6px;
				margin-bottom: 16px;
				font-size: 20px;
				color: rgb(51,51,51);
				text-align: center;/*居中*/
				
			}
			.wrap .infor{
				text-align: center;
				color: #666;
				font-size: 16px;
				margin-bottom: 36px;
				
			}
			.wrap .infor a{
				text-decoration: none;
				color:#3481cf;
			}
			.wrap #form{
				text-align: center;
				height:150px ;
				width: 272px;
				margin: 0px auto;
				
			}
			.wrap #form .input{
				height: 38px;
				width: 268px;
				box-sizing: border-box;
				padding: 10px;
				padding-right: 0px;
				margin-bottom: 17px;
				border-radius: 3px;
				border: solid rgb(214,214,21)  1px;
			}
			.wrap #form #btn{
				border-radius: 3px;
				height: 37px;
				width: 258px;
				padding: 1px 7px 2px 7px;
				box-sizing: content-box;
				border: none;
				background-color:rgb(136,210,48) ;
				color: white;
				font-size: 17px;
			}
		</style>
	</head>
	<body>
		<div class="wrap"><!--登录框的最外部的框框-->
			<div class="title"><!--账号密码字体存放的div-->
				账号密码登录
			</div>
			<div class="infor"> <!--第二行字存放的div-->
				推荐使用<a href="">快速安全登录</a>,防止盗号。
			</div>
			<form action="" method="post" id="form"> <!--账号密码登录的一个from表单-->
				<input type="text" class="input" placeholder="支持QQ号/邮箱/手机号登录"/>
				<input type="text"class="input" placeholder="密码"/>
				<button type="button" id="btn">登 录</button>
				<!--简单来讲就是一个大的方块(wrap)包含了title,infor,from三大块的信息,from中又包含了账号,密码,登录三个块块-->
				
			</form>
		</div>
		
	</body>
</html>
  • 12
    点赞
  • 49
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值