1 HTML部分:
![在这里插入图片描述](https://img-blog.csdnimg.cn/8827b5fc15c1426896b31ec2c7835f57.png)
![你好! 这是你第一次使用 **Markdown编辑器** 所展示的欢迎页。如果你想学习如何使用Markdown编辑器, 可以仔细阅读这篇文章,了解一下Markdown的基本语法知识。](https://img-blog.csdnimg.cn/7ea7bebe817a4aed89b5faa39f8aeae2.png)
2: CSS部分
Login
<div id="avatar">
</div>
<div id="account">
<div class="input-box"><input type="text" placeholder="Please input username"></div>
<div class="input-box"><input type="password" placeholder="Please input password"></div>
</div>
<button class="login-btn">Sign In</button>
<div id="footer">
<a href="#">Forget Password?</a>
</div>
</div>
CSS代码部分:
@charset “utf-8”;
/统一设置/
*{
margin: 0;
padding: 0;
}
/网页背景图片/
body{
background: url(“background.jpg”) no-repeat ;
background-size: cover;
}
/登陆区主体/
#main{
width: 350px;
height: 600px;
background: rgba(0,0,0,0.5);
margin: 40px auto;
border-top: 8px solid #ffc5d1;
position: relative;
}
/头像区/
#avatar{
width: 184px;
height: 184px;
background: url(“avatar.jpg”) no-repeat;
background-size: cover;
margin: 50px auto;
border-radius: 50%;
}
/账号密码区/
#account{
width: 75%;
/height: 200px;/
/background: #ffd1e4;/
margin: 0 auto;
}
#account .input-box{
height: 50px;
/background: #ffbcdd;/
}
#account .input-box input{
height: 40px;
width: calc(100% - 10px);
border: none;
outline: none;
padding: 0 5px;
background: rgba(0,0,0,0.5);
color: #ffcae5;
font-size: 16px;
}
/登录按钮/
.login-btn{
width: 75%;
height: 40px;
display: block;
margin: 30px auto;
background:#ffc5d1 ;
border: none;
outline: none;
color: #fff;
font-size: 16px;
cursor: pointer;
}
/按下按钮/
.login-btn:active{
position: relative;
top:2px;
}
/登陆区底部/
#footer{
height: 50px;
text-align: center;
line-height: 50px;
position: absolute;
bottom: 0;
width: 100%;
border-top: 1px solid #ccc;
}
#footer a{
color: #ccc;
text-decoration: none;
}
#footer a:hover{
color: red;
}
3: 实际代码
![在这里插入图片描述](https://img-blog.csdnimg.cn/8079d0a489f5460ba04c42e93c504699.png)
![在这里插入图片描述](https://img-blog.csdnimg.cn/dbd2232ce1eb4a64ba440560b9cab41a.png)
![在这里插入图片描述](https://img-blog.csdnimg.cn/30ce0eaa77fb427d8dab018aed2d30fe.png)
![在这里插入图片描述](https://img-blog.csdnimg.cn/04dc8768762f489fbc52a82a8f0a255a.png)
4: 实际生成页面
![在这里插入图片描述](https://img-blog.csdnimg.cn/bffc511c9b33481a8e2d4eaf5f2b0ec7.png)