HTML+CSS制作登录页面,超详细的讲解(期末毕业设计均可使用)

首先来展示一下完成后的效果

1. 一个简单的登录页面由HTML和CSS两部分组成,用HTML把所有的元素放进页面里面。

HTML部分的代码

<!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>登录网站</title>
    <link rel="stylesheet" href="./login.css">
    <link rel="stylesheet" href="./font-awesome-4.7.0/css/font-awesome.min.css">
</head>
<body>
    <div id="box">
        <h1>login</h1>
        <div class="login">
            <div class="item">
                <i class="fa fa-user-circle-o" aria-hidden="true"></i>
                <input type="text" placeholder="Username">
            </div>
            <div class="log">
                <i class="fa fa-key" aria-hidden="true"></i>
                <input type="text" placeholder="Password">
            </div>
        </div>
        <button>login</button>
    </div>
</body>
</html>

css部分

body{
    background: url('./img/新海诚.jpg');
    background-repeat: no-repeat;
    background-size: 100% auto;
}
#box{
    width: 30%;
    height: auto;
    margin: 0 auto;
    margin-top: 15%;
    text-align: center;
    background: #00000060;
    padding: 20px 50px;
}

#box h1{
    color: #fff;
}

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

#box .form .item i{
    color: #fff;
}

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

#login-box button{
    margin-top: 15px;
    width: 150px;
    height: 30px;
    font-size: 20px;
    font-weight: 500;
    color: #fff;
    background-image: linear-gradient(to top, #fbc2eb 0%, #a6c1ee 100%);
    border: 0; 
    border-radius: 20px;  
}

大家可以复制->粘贴,有什么问题或者需要完整的都可以发在评论区哟。

  • 6
    点赞
  • 63
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值