html登录界面

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    body {
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
    }

    .box {
        overflow: hidden;
        position: relative;
        width: 380px;
        height: 420px;
        background: #1c1c1c;
        border-radius: 8px;
    }

    .box form {
        position: absolute;
        inset: 4px;
        background: #222;
        padding: 50px 40px;
        border-radius: 8px;
        z-index: 2;
        display: flex;
        flex-direction: column;
    }

    .box form h2 {
        color: #fff;
        font-weight: 500;
        text-align: center;
        letter-spacing: 0.1em;
    }

    .box form .inputBox {
        position: relative;
        width: 300px;
        margin-top: 35px;
    }

    .box form .inputBox input {
        position: relative;
        width: 100%;
        padding: 20px 10px 10px;
        background: transparent;
        outline: none;
        border: none;
        box-shadow: none;
        color: #23242a;
        font-size: 1em;
        letter-spacing: 0.05em;
        z-index: 10;
        transition: 0.3s;
    }

    .box form .inputBox span {
        position: absolute;
        left: 0;
        padding: 20px 0px 10px;
        pointer-events: none;
        color: #8f8f8f;
        font-size: 1em;
        letter-spacing: 0.05em;
        transition: 0.5s;
    }

    .box form .inputBox input:valid~span,
    .box form .inputBox input:focus~span {
        color: #fff;
        font-size: 0.75em;
        transform: translateY(-34px);
    }

    .box form .inputBox i {
        position: absolute;
        left: 0;
        bottom: 0;
        width: 100%;
        height: 2px;
        background: #fff;
        border-radius: 5px;
        overflow: hidden;
        transition: 0.5s;
        pointer-events: none;
    }

    .box form .inputBox input:valid~i,
    .box form .inputBox input:focus~i {
        height: 42px;
    }


    .box form .links {
        display: flex;
        justify-content: space-between;
    }

    .box form .links a {
        margin: 10px 0;
        font-size: 0.75em;
        color: #8f8f8f;
    }

    .box form .links a:hover,
    .box form .links a:nth-child(2) {
        color: #fff;
    }


    .box form input[type='submit'] {
        padding: 9px 25px;
        background: #fff;
        cursor: pointer;
        font-size: 0.9em;
        border-radius: 5px;
        font-weight: 600;
        width: 80%;
        margin-top: 10px;
        margin-left: 30px;
    }


    .box form input[type='submit']:active {
        opacity: 0.8;
    }

</style>

<body>
    <body>
        <div class="box">
            <form>
                <h2>Sign In</h2>
                <div class="inputBox">
                    <input type="text" required>
                    <span>User name</span><i></i>
                </div>
                <div class="inputBox">
                    <input type="password" required>
                    <span>Password</span><i></i>
                </div>
                <div class="links">
                    <a href="#">Forget password</a><a href="#">Sing up</a>
                </div>
                <input type="submit" value="Login">
            </form>
        </div>

    </body>
</body>

</html>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值