index.css
body{
background-color: #F2F2F2;
}
/*------主要内容-------*/
#content{
margin-top: 100px;
text-align: center;
}
#content .panel{
display: inline-block;
background-color: white;
border: 1px solid #ddd;
border-radius: 5px;
padding: 20px;
}
#content .panel .group{
}
/*输入框*/
#content .panel .group input{
display: block;
width: 250px;
height: 33px;
padding-left: 7px;
font-size: 15px;
border:1px solid #ddd;
}
/*伪类*/
#content .panel .group input:focus{
outline: none;
border-left-color: #CC865E;
}
#content .panel .group label{
display: block;
text-align: left;
height: 30px;
line-height: 30px;
font-size: 20px;
}
#content .login {
margin-top: 20px;
}
/*登录*/
#content .login button{
width: 250px;
background-color: #CC865E;
}
#content .login button:hover{
background-color: white;
color: #CC865E;
border: 1px solid #CC865E;
cursor: pointer;
}
#content button{
height: 33px;
border: 0px;
color: white;
font-size: 18px;
}
/*注册*/
#content .reg{
margin-top: 20px;
}
#content .reg button{
width: 200px;
background-color: #466BAF;
}
#content .reg button:hover{
background-color: white;
color: #466BAF;
border: 1px solid #466BAF;
cursor: pointer;
}
index.html
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>登录首页</title>
<link href="css/index.css" rel="stylesheet">
</head>
<body>
<!--最外层-->
<div id="content">
<!--面板-->
<div class="panel">
<!--账号-->
<div class="group">
<label>账号</label>
<input placeholder="请输入账号名">
</div>
<!--密码-->
<div class="group">
<label>密码</label>
<input placeholder="请输入密码" type="password">
</div>
<!--登录-->
<div class="login">
<button>登录</button>
</div>
</div>
<!--注册-->
<div class="reg">
<button>创建新账号?</button>
</div>
</div>
</body>
</html>
网友评论