HTML+CSS登录界面

HTML+CSS登录界面💖


  • 忙碌的国庆节,不是在回家的路上就是在准备出发的路上,各种事情,使得国庆也不轻松,不过也算圆满完成任务,今日发现一个好看的登录界面,分享一波🤩

😏废话不多说,直接上内容代码~


html~index.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="../css/index.css">
</head>
<body>
    <div class="box">
        <div class="left"></div>
        <div class="right">
            <h4>登录</h4>
            <form action="" method="">
                <input class="acc" type="text" placeholder="用户名">
                <input class="acc" type="password" placeholder="密码">
                <input class="submit" type="submit" value="Login"> 
            </form>
            <div class="fn">
                <a href="javascript:;">注册账号</a>
                <a href="javascript:;">找回密码</a>
            </div>
        </div>
    </div>
</body>
</html>
  • 内容很简单主要使用了div/form/input/a/……等常用标签,剩下就交给样式吧~

😉CSS样式内容稍多一点,没办法为了好看嘛~


css~index.css文件内容>>>

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 字体大小设置 */

html{
    font-size: 10px;
    background: url(../img/day10.jpg) no-repeat;
    background-size: cover;
}

/* 设置前背景色 */
html::before{
    content: '';
    width: 100%;
    height: 100%;
    position: fixed;
    z-index: -1;
    /* background-image: linear-gradient(to right, #ff9569 0%, #e92758 100%); */
    /* background-image: linear-gradient(-90deg, #29bdd9 0%, #276ace 100%); */
    /* background-image: linear-gradient(120deg, #e0c3fc 0%, #8ec5fc 100%); */
    backdrop-filter: blur(0.25rem);

}

::selection{
    color: #fff;
    background-color: rgb(144,129,241);
}

/* 设置box的样式*/
.box{
    display: flex;
    overflow: hidden;
    width: 90rem;
    height: 55rem;
    background-color: rgba(255, 255, 255, 60%);
    border-radius: 1.5rem;
    margin: 10% auto;
    box-shadow: 0 0 1rem 0.rem rgb(0 0 0 / 10%);
}

.box .left{
    position: relative;
    width: 35%;
    height: 100%;
    background-color: skyblue;
}

.box .left::before{
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: url(../img/da12.jpg);
    background-size: cover;
    opacity: 80%; 
}

.box .right{
    display: flex;
    width: 65%;
    flex-direction: column;
    align-items: center;
}

.box .right h4{
    color: rgb(144,129,241);
    font-size: 3rem;
    margin-top: 5rem;
}

.box .right form{
    display: flex;
    flex-wrap: wrap;
}

.box .right form .acc{
    outline:none;
    width: 80%;
    height: 5rem;
    font-size: 1.6rem;
    margin-top: 5rem;
    padding: 1rem 0 0 1.6rem;
    border: none;
    border-bottom: 1px solid rgb(144,129,241);
    color: rgb(144,129,241);
    background-color: rgb(0,0,0,0);
}

/* right 右边的具体样式 */
.right form .acc:focus{
    outline:none;
    color: rgb(144,129,241);
    padding: 1rem 0 0 1.6rem;
}

.right .submit{
    width: 60%;
    height: 5rem;
    color: #f6f6f6;
    background-image: linear-gradient(120deg, #e0c3fc 0%,#8ec5fc 110%);
    font-size: 1.4rem;
    border: none;
    border-radius: 0.5rem;
    margin: 6rem 0 0 50%;
    transform: translateX(-50%);
}

.right .submit:hover{
    box-shadow: 0 0 2rem -0.5rem rgb(0 0 0 / 15%);
}

.right .fn{
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    width: 70%;
}

.right .fn a{
    font-size: 1.3rem;
    margin-top: 5rem;
    padding: 1rem 2rem;
    color: #666;
}

.right .fn a:hover{
    color: rgb(144,129,241);
}



😋最后效果展示

在这里插入图片描述


🎉🎉🎉🎉🎉国庆节快乐~🎉🎉🎉🎉🎉

  • 6
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

每日小新

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值