效果:
代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
*{
margin: 0;
padding: 0;
outline: none;
box-sizing: border-box;
text-decoration: none;
}
.mb20{
margin-bottom: 20px;
}
.login_wrap{
margin: 50px auto;
padding: 10px 20px;
width: 400px;
background-color: #faebd7;
}
.login_wrap .title{
font-size: 20px;
line-height: 60px;
}
.form_item{
position: relative;
width: 100%;
height: 32px;
}
.form_item span{
position: absolute;
top: 3px;
left: 3px;
width: 13px;
height: 13px;
}
.form_item input{
padding: 0 30px;
width: 100%;
height: inherit;
border: none;
}
#submit_btn{
cursor: pointer;
border: none;
color: #ffffff;
background-color: #1e90ff;
}
.more{
display: flex;
justify-content: space-between;
align-items: center;
}
.more a{
font-size: 12px;
color: #0000ff;
}
</style>
</head>
<body>
<div class="login_wrap">
<div class="title">用户登录</div>
<!-- <hr/> -->
<form id="form" action="">
<div class="form_item mb20">
<span>👤</span>
<input type="text" value="" id="username" placeholder="请输入用户名"/>
</div>
<div class="form_item mb20">
<span>🔐</span>
<input type="password" value="" id="password" placeholder="请输入密码"/>
</div>
<div>
<button id="submit_btn" class="form_item" type="button">提交</button>
</div>
<div class="form_item more">
<a href="">注册账户</a>
<a href="">忘记密码</a>
</div>
</form>
</div>
</body>
</html>