分享

超高颜值的HTML CSS登录页面!附源码!

 只怕想不到 2024-10-19

第一个登录框

效果

图片

源码

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

<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <style>
        * {
            margin0;
            padding0;
        }

        html {
            height100%;
        }

        body {
            height100%;
        }

        .gradient-bg {
            height100%;
            background-imagelinear-gradient(to right, #fbc2eb, #a6c1ee);
        }

        .login-box {
            background-color#fff;
            width358px;
            height588px;
            border-radius15px;
            padding0 50px;
            position: relative;
            left50%;
            top50%;
            transformtranslate(-50%, -50%);
        }

        .login-header {
            font-size38px;
            font-weight: bold;
            text-align: center;
            line-height200px;
        }

        .input-field {
            display: block;
            width100%;
            margin-bottom20px;
            border0;
            padding10px;
            border-bottom1px solid rgb(128125125);
            font-size15px;
            outline: none;
        }

        .input-field::placeholder {
            text-transform: uppercase;
        }

        .login-button {
            text-align: center;
            padding10px;
            width100%;
            margin-top40px;
            background-imagelinear-gradient(to right, #a6c1ee, #fbc2eb);
            color#fff;
            border-radius8px;
        }

        .message {
            text-align: center;
            line-height88px;
        }

        a {
            text-decoration-line: none;
            color#abc1ee;
        }
    
</style>
</head>

<body>
    <div class='gradient-bg'>
        <div class='login-box'>
            <div class='login-header'>请你登录</div>
            <div class='form-content'>
                <input type='text' name='username' placeholder='账号' class='input-field'>
                <input type='password' name='password' placeholder='密码' class='input-field'>
                <div class='login-button'>登录</div>
            </div>
            <div class='message'> 如果没有账户? <a href='#'>请先注册</a> </div>
        </div>
    </div>
</body>

</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>
    <style>
        * {
            margin0;
            padding0;
        }

        a {
            text-decoration: none;
        }

        input,
        button {
            background: transparent;
            border0;
            outline: none;
        }

        body {
            height100vh;
            backgroundlinear-gradient(#282a36, #44475a);
            display: flex;
            justify-content: center;
            align-items: center;
            font-size16px;
            color#bd93f9;
        }

        .auth-container {
            width400px;
            height364px;
            background-color#21222c;
            margin100px auto;
            border-radius10px;
            box-shadow0 15px 25px 0 rgba(000, .6);
            padding40px;
            box-sizing: border-box;
        }

        h2 {
            text-align: center;
            color#bd93f9;
            margin-bottom30px;
            font-family'Courier New', Courier, monospace;
        }

        .input-group {
            height45px;
            border-bottom1px solid #fff;
            margin-bottom40px;
            position: relative;
        }

        .input-group input {
            width100%;
            height100%;
            color#fff;
            padding-top20px;
            box-sizing: border-box;
        }

        .input-group input:focus + label,
        .input-group input:valid + label {
            top0px;
            font-size12px;
        }

        .input-group label {
            position: absolute;
            left0;
            top12px;
            transition: all 0.5s linear;
        }

        .auth-button {
            padding10px 20px;
            margin-top30px;
            color#bd93f9;
            position: relative;
            overflow: hidden;
            text-transform: uppercase;
            letter-spacing2px;
            left35%;
        }

        .auth-button:hover {
            border-radius5px;
            color#fff;
            background#bd93f9;
            box-shadow0 0 5px 0 #bd93f90 0 25px 0 #bd93f90 0 50px 0 #bd93f90 0 100px 0 #bd93f9;
            transition: all 1s linear;
        }

        .auth-button > span {
            position: absolute;
        }

        .auth-button > span:nth-child(1) {
            width100%;
            height2px;
            background-webkit-linear-gradient(left, transparent, #bd93f9);
            left: -100%;
            top0px;
            animation: line1 1s linear infinite;
        }

        @keyframes line1 {

            50%,
            100% {
                left100%;
            }
        }

        .auth-button > span:nth-child(2) {
            width2px;
            height100%;
            background-webkit-linear-gradient(top, transparent, #bd93f9);
            right0px;
            top: -100%;
            animation: line2 1s 0.25s linear infinite;
        }

        @keyframes line2 {

            50%,
            100% {
                top100%;
            }
        }

        .auth-button > span:nth-child(3) {
            width100%;
            height2px;
            background-webkit-linear-gradient(left, #bd93f9, transparent);
            left100%;
            bottom0px;
            animation: line3 1s 0.75s linear infinite;
        }

        @keyframes line3 {

            50%,
            100% {
                left: -100%;
            }
        }

        .auth-button > span:nth-child(4) {
            width2px;
            height100%;
            background-webkit-linear-gradient(top, transparent, #bd93f9);
            left0px;
            top100%;
            animation: line4 1s 1s linear infinite;
        }

        @keyframes line4 {

            50%,
            100% {
                top: -100%;
            }
        }
    
</style>
</head>

<body>
    <div class='auth-container'>
        <h2>请登录</h2>
        <form action=''>
            <div class='input-group'> <input type='text' required> <label for=''>用户名</label> </div>
            <div class='input-group'> <input type='password' required> <label for=''>密码</label> </div>
            <button class='auth-button'>提交 <span></span> <span></span> <span></span> <span></span> </button>
        </form>
    </div>
</body>

</html>

第三给登录框

效果

图片

源码

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

<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Login Form</title>
    <style>
        * {
            padding0;
            margin0;
        }

        html {
            height100%;
        }

        body {
            background-imagelinear-gradient(to bottom right, #636EFA, #1E88E5);
        }

        .auth-container {
            width600px;
            height315px;
            margin0 auto;
            margin-top10%;
            border-radius15px;
            box-shadow0 10px 50px 0 rgba(3450710.8);
            background-color#2D3436;
        }

        .left-panel {
            display: inline-block;
            width330px;
            border-top-left-radius15px;
            border-bottom-left-radius15px;
            padding60px;
            background-imagelinear-gradient(to bottom right, #636EFA, #1E88E5);
        }

        .panel-title {
            color#fff;
            font-size18px;
            font-weight200;
        }

        .panel-title span {
            border-bottom3px solid #4CAF50;
        }

        .input-panel {
            padding20px 0;
        }

        input {
            border0;
            background: none;
            outline: none;
            color#fff;
            margin20px 0;
            display: block;
            width100%;
            padding5px 0;
            transition: .2s;
            border-bottom1px solid #BDBDBD;
        }

        input:hover {
            border-bottom-color#fff;
        }

        ::-webkit-input-placeholder {
            color#BDBDBD;
        }

        .message-panel {
            font-size14px;
            transition: .2s;
            color#BDBDBD;
            cursor: pointer;
        }

        .message-panel:hover {
            color#fff;
        }

        .right-panel {
            width145px;
            display: inline-block;
            heightcalc(100% - 120px);
            vertical-align: top;
            padding60px 0;
        }

        .register-panel {
            text-align: center;
            color#fff;
            font-size18px;
            font-weight200;
        }

        .register-panel span {
            border-bottom3px solid #4CAF50;
        }

        .action-panel {
            font-size10px;
            color#fff;
            text-align: center;
            position: relative;
            top200px;
        }

        .action-panel span {
            border1px solid #4CAF50;
            padding10px;
            display: inline;
            line-height20px;
            border-radius20px;
            position: absolute;
            bottom10px;
            leftcalc(72px - 20px);
            transition: .2s;
            cursor: pointer;
        }

        .action-panel span:hover {
            background-color#4CAF50;
            color#2D3436;
        }
    
</style>
</head>

<body>
    <div class='auth-container'>
        <div class='left-panel'>
            <div class='panel-title'><span>登录</span></div>
            <div class='input-panel'> 
                <input type='text' name='username' placeholder='用户名'> 
                <input type='password' name='password' placeholder='密码'> 
            </div>
            <div class='message-panel'> 
                <span>忘记密码</span> 
            </div>
        </div>
        <div class='right-panel'>
            <div class='register-panel'> 
                <span>注册</span> 
            </div>
            <div class='action-panel'> 
                <span>提交</span> 
            </div>
        </div>
    </div>
</body>

</html>

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多