HTML+CSS 巨好看的登录注册界面 !附源码!!

展示效果

源码

<!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>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            width: 100%;
            height: 100%;
        }

        .container {
            width: 100%;
            height: 100vh;
            background-color: #f0f8ff;
            /* 淡蓝色背景 */
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .form-container {
            width: 900px;
            height: 550px;
            background: #ffffff;
            border-radius: 4px;
            position: relative;
        }

        .form-panel {
            position: absolute;
            left: 0;
            transition: 0.5s all ease-in-out;
        }

        .form-panel .login-form,
        .registration-form {
            width: 640px;
            height: 100%;
            display: flex;
            flex-flow: column nowrap;
            align-items: center;
            padding: 50px 30px;
        }

        .form-panel h1 {
            margin-bottom: 35px;
        }

        .form-panel .form-section {
            width: 100%;
            margin-bottom: 30px;
            display: flex;
            align-items: flex-end;
            justify-content: center;
            gap: 6px;
        }

        .form-panel .form-section label {
            font-size: 14px;
            color: #909399;
            text-transform: uppercase;
            /* margin-bottom: 8px; */
        }

        .form-panel .form-section input {
            width: 50%;
            outline: 0;
            border: none;
            font-size: 18px;
            color: #008080;
            /* 马卡龙淡绿色 */
            text-align: center;
            padding: 4px 10px;
            border-bottom: 1px solid rgba(0, 0, 0, 0.4);
        }

        .form-panel .form-section span {
            color: #5f9ea0;
            /* 马卡龙淡绿色 */
            font-size: 15px;
            cursor: pointer;
            margin-top: 18px;
        }

        .form-panel button {
            width: 50%;
            padding: 6px 0;
            text-align: center;
            border: 3px solid #87cefa;
            /* 淡蓝色 */
            border-radius: 20px;
            background: #87cefa;
            /* 淡蓝色 */
            color: #fff;
            font-size: 17px;
            letter-spacing: 6px;
            text-indent: 6px;
            margin-bottom: 15px;
            cursor: pointer;
        }

        .form-panel .alternative-login {
            border: 3px solid #add8e6;
            /* 浅淡蓝色 */
            background: #ffffff;
            color: #add8e6;
            /* 浅淡蓝色 */
            font-weight: 600;
        }

        .registration-panel {
            width: 260px;
            height: 100%;
            background: linear-gradient(to bottom right, #add8e6 0%, #87cefa 50%, #00bfff 100%);
            /* 淡蓝色渐变 */
            border-top-right-radius: 4px;
            border-bottom-right-radius: 4px;
            position: absolute;
            left: 640px;
            top: 0;
            display: flex;
            flex-flow: column nowrap;
            align-items: center;
            padding: 50px 0;
            color: white;
            transition: all 1s ease-in-out;
        }

        .registration-panel .panel-title {
            margin-bottom: 10px;
            transition: all 0.3s ease-in-out;
        }

        .registration-panel button {
            margin-top: 260px;
            width: 50%;
            padding: 8px 0;
            border-radius: 14px;
            letter-spacing: 10px;
            text-indent: 10px;
            font-size: 18px;
            color: #fff;
            border: 3px solid #fff;
            background: transparent;
            font-weight: 700;
            cursor: pointer;
        }

        .registration-panel button:hover {
            border: 3px solid #00bfff;
            /* 马卡龙淡蓝色 */
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="form-container">
            <div class="form-panel">
                <div class="login-form">
                    <h1>欢迎回来</h1>
                    <section class="form-section">
                        <label for="email">邮箱</label>
                        <input type="text" id="email" />
                    </section>
                    <section class="form-section">
                        <label for="password">密码</label>
                        <input type="password" id="password" />
                    </section>
                    <span style="margin-bottom: 8px;">忘记密码?</span>

                    <button type="button">登录</button>
                    <button type="button" class="alternative-login"> 使用<span
                            style="font-weight: 900; color: #455a81">二维码</span>登录 </button>
                </div>
                <div class="registration-form" style="display: none">
                    <h1>立即注册</h1>
                    <section class="form-section">
                        <label for="username">用户名</label>
                        <input type="text" id="username" />
                    </section>
                    <section class="form-section">
                        <label for="email">邮箱</label>
                        <input type="text" id="email" />
                    </section>
                    <section class="form-section">
                        <label for="password">密码</label>
                        <input type="password" id="password" />
                    </section>
                    <button type="button">注册</button>
                    <button type="button" class="alternative-login"> 使用<span
                            style="font-weight: 900; color: #455a81">二维码</span>扫码注册 </button>
                </div>
            </div>
            <div class="registration-panel">
                <h1 class="panel-title">还未注册?</h1>
                <span class="subTitle">立即注册,发现大量机会!</span>
                <button type="button" id="toggleForm">注册</button>
            </div>
        </div>
    </div>
    <script>
        const toggleButton = document.getElementById('toggleForm');
        const loginForm = document.querySelector('.login-form');
        const registrationForm = document.querySelector('.registration-form');
        const formPanel = document.querySelector('.form-panel');
        const registrationPanel = document.querySelector('.registration-panel');
        const panelTitle = document.querySelector('.panel-title');
        const subTitle = document.querySelector('.subTitle');
        let isRegistrationMode = false;

        function toggleLoginAndRegistration() {
            if (isRegistrationMode) {
                registrationPanel.style.left = '640px';
                formPanel.style.left = '0';
                toggleButton.innerText = '注册';
                panelTitle.innerText = '还未注册?';
                subTitle.innerText = '立即注册,发现大量机会!';
                setTimeout(() => {
                    loginForm.style.display = 'flex';
                    registrationForm.style.display = 'none';
                }, 300);
            } else {
                registrationPanel.style.left = '0';
                formPanel.style.left = '260px';
                toggleButton.innerText = '登录';
                panelTitle.innerText = '已有帐号?';
                subTitle.innerText = '有帐号就登录吧,好久不见了!';
                setTimeout(() => {
                    loginForm.style.display = 'none';
                    registrationForm.style.display = 'flex';
                }, 300);
            }
            isRegistrationMode = !isRegistrationMode;
        }

        toggleButton.addEventListener('click', toggleLoginAndRegistration);
    </script>
</body>

</html>

最后

有写错的,或者有什么问题,欢迎大家评论

大家喜欢点点关注,点点赞

### 回答1: 要在Navicat Premium中创建表格,可以按照以下步骤操作: 1. 打开Navicat Premium软件,连接到相应的数据库。 2. 在左侧的导航栏中选择要创建表格的数据库。 3. 在工具栏中选择“表格”选项卡,然后点击“新建表格”。 4. 在弹出的对话框中,输入表格的名称和字段信息。可以设置字段的名称、数据类型、长度、是否允许为空等属性。 5. 点击“确定”按钮,即可创建新的表格。 6. 可以在表格中添加、修改或删除字段,也可以设置主键、索引等约束条件。 7. 最后,记得保存表格的修改,以便后续的使用和查询。 以上就是在Navicat Premium中创建表格的基本步骤,希望对您有所帮助。 ### 回答2: Navicat Premium是一个跨平台的数据库管理工具,在其中创建数据库表格的过程如下: 1. 打开Navicat Premium并连接到一个数据库。若没有可用的数据库,可以在“文件”菜单栏中选择“新建数据库”创建一个新的MySQL、Oracle、PostgreSQL或SQLite数据库。 2. 在“对象”树形视图中,选择要创建表格的数据库。右键单击并选择“新建表格”。 3. 在“新建表格”对话框中,填写表格的名称和别名。在MySQL数据库中,别名是可选的。 4. 在“新建表格”对话框的字段选项卡中,填写表格中的字段。对于每个字段,需要设置其名称、数据类型、长度、默认值以及其他约束条件(如非空性、唯一性、主键等)。 5. 在字段设置完毕后,可以在选项卡中添加或移除索引、触发器和约束(如外键约束)。 6. 在“新建表格”对话框的“选项”选项卡中,可以设置表格的字符集、排序规则、存储引擎和注释等属性。 7. 点击“确定”按钮以创建表格。在“对象”树形视图中,可以看到新创建的表格。 8. 右键单击新创建的表格,并选择“设计表格”可以进一步编辑表格的结构和属性。 总之,使用Navicat Premium创建表格需要了解数据库的数据类型和约束条件,需要仔细填写字段信息和选项卡中的其他属性,以确保表格的正确性和完整性。同时,需要注意不同数据库的特性和语法,以避免出现错误或不兼容性。 ### 回答3: Navicat Premium是一款功能强大的数据库管理工具,它能够支持多种类型的数据库,包括MySQL、MariaDB、Oracle、SQL Server等。当我们使用Navicat Premium来管理数据库时,其中一个最基本的操作就是创建表格,下面我们来详细介绍如何使用Navicat Premium创建表格。 1.打开Navicat Premium,连接到所需数据库。 2.在左侧导航栏中选择所需数据库,然后右键单击,在弹出的菜单中选择“新建表格”。或者在左侧,“表格”文件夹上单击右键,选择“新建表格”。 3.在创建新表格的对话框中填入表格的名称,以及列名、数据类型和其他属性等信息。 4.在列名、数据类型和其他属性等填好后,还需要指定每一列的约束(如主键约束、唯一约束、外键约束等),这是确保表格中数据的正确性和完整性的重要方式之一。 5.完成输入后,单击“确定”按钮,此时Navicat Premium会根据用户的输入自动生成相应的SQL语句,并在数据库中创建对应的表格。 上述就是使用Navicat Premium 创建表格的基本步骤,当然,在创建表格时还有很多其他的细节需要关注。例如,在设置数据类型时,要根据实际需要选择恰当的数据类型,以确保表格中的数据正确性和节省存储空间。再例如,在设置约束时,要遵循设计原则,确保设计出的表格结构符合数据库正规化规则,能够支持数据的高效查询和更新。 总之,使用Navicat Premium创建表格需要认真考虑细节,只有在充分了解数据需求和数据库设计原则的情况下才能最好地完成操作。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

小白讲前端

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

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

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

打赏作者

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

抵扣说明:

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

余额充值