运行效果
代码
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录界面</title>
<link rel="stylesheet" href="css/animate.css">
<link href="css/index.css" rel="stylesheet">
</head>
<body>
<div id="panel">
<div class="panel-header">
<h2>系统</h2>
</div>
<div class="panel-content">
<div class="user-pwd">
<img src="images/icon_people.png">
<input placeholder="请输入用户名/手机号" name="user">
</div>
<div class="user-pwd">
<img src="images/icon_password.png">
<input placeholder="请输入密码" type="password" name="pwd">
</div>
<div class="setting">
<a href="#"><input type="checkbox"> 下次自动登录</a>
<a href="#" class="pull-right">忘记密码?</a>
</div>
<button class="login-btn">登 录</button>
<div class="reg">
还没账号? <a href="#">立即注册</a>
</div>
</div>
<div class="panel-footer">
<span>社交账号登录: </span>
<img src="images/sina.png">
<img src="images/weixin.png">
<img src="images/qq.png">
</div>
</div>
<script type="text/javascript" src="js/jquery-3.3.1.js"></script>
</body>
</html>
index.css
*{
padding: 0;
margin: 0;
box-sizing: border-box;
}
a{
text-decoration: none;
color: black;
}
body{
background: url("../images/bg.png") no-repeat;
background-size: cover;
text-align: center;
}
#panel{
width:400px;
height: 400px;
background-color: white;
text-align: left;
border-radius: 5px;
box-shadow: -10px 20px 100px black;
position: absolute;
top:50%;
left:50%;
margin-left: -200px;
margin-top: -200px;
}
.panel-header{
width:100%;
height:64px;
background-color: orangered;
border-radius: 5px 5px 0 0;
line-height: 64px;
color:white;
text-align: center;
margin-bottom: 10px;
cursor:default;
}
.panel-content{
padding: 20px;
}
.panel-content .user-pwd{
margin-bottom: 15px;
height: 40px;
position: relative;
}
.panel-content .user-pwd img{
position: absolute;
top: 7px;
left: 6px;
}
.panel-content .user-pwd input{
width: 100%;
height: 100%;
box-sizing: border-box;
padding-left: 38px;
border-radius: 5px;
border:1px solid #dddddd;
}
.panel-content .user-pwd input:focus{
outline: none;
border: 1px solid orange;
panel-header: 0 0 10px orange;
}
.setting a{
color: darkgray;
font-size: 13px;
}
.setting a.pull-right{
float: right;
}
.login-btn{
margin: 15px 0;
width: 100%;
height: 38px;
background-color: orangered;
border: 0;
font-size: 20px;
color: white;
border-radius: 5px;
cursor: pointer;
}
.login-btn:focus{
outline: none;
}
.reg{
text-align: center;
margin-bottom: 15px;
color: darkgray;
font-size: 13px;
}
.reg a{
color: orangered;
}
.panel-footer{
padding:0 20px;
height: 44px;
line-height: 44px;
}
.panel-footer img{
width: 30px;
vertical-align: middle;
}