好看的前端登录页面(HTML+CSS)

效果图

在这里插入图片描述
在这里插入图片描述在这里插入图片描述

代码

HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Login</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
<div id="login-box">
    <form action="">
        <h1>Login</h1>
        <div class="form">
            <div class="item">
                <i class="fa fa-user-circle-o" aria-hidden="true"></i>
                <input type="text" placeholder="Username" required/>
            </div>
            <div class="item">
                <i class="fa fa-key" aria-hidden="true"></i>
                <input type="password" placeholder="Password" required/>
            </div>
        </div>
        <button type="submit">Login</button>
    </form>
</div>
</body>
</html>

CSS

body {
    /*在这里可以设置不同的网页背景图片,也可以设置为循环播放的,暂时没实现*/
    background: url('24hr-Earth_11.jpeg');
    /*background: url('earth_view_1.jpeg');*/
    /*background: url('earth_view_2.jpeg');*/
    background-repeat: no-repeat;
    background-size: 100% auto;
}

#login-box {
    width: 30%;
    height: auto;
    margin: 0 auto;
    margin-top: 15%;
    text-align: center;
    background: #00000090;
    padding: 20px 50px;
}

#login-box h1 {
    color: #fff;
}

#login-box .form .item {
    margin-top: 15px;
}

#login-box .form .item i {
    font-size: 18px;
    color: #fff;
}

#login-box .form .item input {
    width: 180px;
    font-size: 18px;
    border: 0;
    border-bottom: 2px solid #fff;
    padding: 5px 10px;
    background: #ffffff00;
    color: #fff;
}

#login-box button {
    margin-top: 15px;
    width: 180px;
    height: 30px;
    font-size: 20px;
    font-weight: 400;
    color: #fff;
    border: 0;
    border-radius: 15px;
    /*在这里可以设置不同Login提交按钮的样式*/
    /*background: #1abc9c;*/
    /*background-image: linear-gradient(to right, #43e97b 0%, #38f9d7 100%);*/
    background-image: linear-gradient(to right, #e4afcb 0%, #b8cbb8 0%, #b8cbb8 0%, #e2c58b 30%, #c2ce9c 64%, #7edbdc 100%);
}

资源

百度云链接,提取码: kk8r
资源中的三张图片,可以做高清壁纸哦,如果此文章对你有用的话,请给个一键三连~O(∩_∩)O~

参考

HTML和CSS实现炫酷的登录页面

  • 28
    点赞
  • 116
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值