Html+Css打造一个精美的注册页面

效果图

在这里插入图片描述

代码
<!DOCTYPE html>
<html lang="ch">
<head>
    <meta charset="UTF-8">
    <title>用户注册</title>
    <style>
        *{
            margin: 0px;
            padding: 0px;
            box-sizing: border-box;
        }

        body{
            background-image: url("img/register_bg.png");
            padding-top: 25px;
        }

        .re_div{
            border: 8px solid #EEEEEE;
            width: 900px;
            height: 500px;
            background-color: white;
            margin: auto;
        }

        .cLeft{
            float: left;
            margin: 15px;
        }
        #p1{
            color: #FFD026;
            font-size: 20px;
        }
        #p2{
            color: #A6A6A6;
            font-size: 20px;
        }
        .cCenter{
            float: left;
        }
        .td_left{
            width: 100px;
            height: 50px;
            text-align: right;
            color: #A6A6A6;
        }
        .td_right{
            padding-left: 50px;
            color: #A6A6A6;
        }
        #username,#password,#email,#name,#tel,#birthday,#checkcode{
            width: 251px;
            height: 32px;
            border: 1px solid #A6A6A6;
        /*    设置边框圆角*/
            border-radius: 10px;
            padding-left: 10px;
        }
        #checkcode{
            width: 110px;
        }
        #cheImg{
            height: 32px;
            vertical-align: middle;
        }
        #btn_sub{
            width: 150px;
            height: 40px;
            background-color: #FFD026;
            border: 1px solid #FFD026;
        }
        .cRight{
            font-size: 15px;
            margin: 15px;
            float: right;
        }
        .cRight p a{
            color: pink;
        }

    </style>
</head>
<body>
<div class="re_div">
    <div class="cLeft">
        <p id="p1">新用户注册</p>
        <p id="p2">USER REGISTER</p>
    </div>
    <div class="cCenter">
        <table>
            <tr>
                <td class="td_left"><label for="username">用户名</label></td>
                <td class="td_right"><input type="text" name="username" id="username" placeholder="请输入用户名"></td>
            </tr>

            <tr>
                <td class="td_left"><label for="password">密码</label></td>
                <td class="td_right"><input type="password" name="password" id="password" placeholder="请输入密码"></td>
            </tr>

            <tr>
                <td class="td_left"><label for="email">Email</label></td>
                <td class="td_right"><input type="email" name="email" id="email" placeholder="请输入邮箱"></td>
            </tr>

            <tr>
                <td class="td_left"><label for="name">姓名</label></td>
                <td class="td_right"><input type="text" name="name" id="name" placeholder="请输入姓名"></td>
            </tr>

            <tr>
                <td class="td_left"><label for="tel">手机号</label></td>
                <td class="td_right"><input type="text" name="tel" id="tel" placeholder="请输入手机号"></td>
            </tr>

            <tr>
                <td class="td_left"><label>性别</label></td>
                <td class="td_right">
                    <input type="radio" name="gender" value="male"> 男
                    <input type="radio" name="gender" value="female"> 女
                </td>
            </tr>

            <tr>
                <td class="td_left"><label for="birthday">出生日期</label></td>
                <td class="td_right"><input type="date" name="birthday" id="birthday" placeholder="请输入出生日期"></td>
            </tr>

            <tr>
                <td class="td_left"><label for="checkcode" >验证码</label></td>
                <td class="td_right"><input type="text" name="checkcode" id="checkcode" placeholder="请输入验证码">
                    <img id="cheImg" src="img/verify_code.jpg">
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center"><input id="btn_sub" type="submit" value="注册"></td>
            </tr>
        </table>
    </div>
    <div class="cRight">
        <p id="p3">已有账号?<a href="#">立即登录</a></p>
    </div>
</div>
</body>
</html>
  • 16
    点赞
  • 70
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
很抱歉,作为AI语言模型,我没有具体的界面和实现能力。但是,我可以为您提供一个基本的HTML CSS JS模板,您可以在此基础上进行修改和完善。 HTML模板: ``` <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Login/Register</title> <link rel="stylesheet" href="style.css"> </head> <body> <div class="container"> <div id="login-form"> <h2>Login</h2> <form> <input type="email" placeholder="Email" required> <input type="password" placeholder="Password" required> <button type="submit">Login</button> </form> </div> <div id="register-form"> <h2>Register</h2> <form> <input type="text" placeholder="Name" required> <input type="email" placeholder="Email" required> <input type="password" placeholder="Password" required> <button type="submit">Register</button> </form> </div> </div> <script src="script.js"></script> </body> </html> ``` CSS模板: ``` * { box-sizing: border-box; } body { margin: 0; padding: 0; font-family: Arial, sans-serif; background-color: #f2f2f2; } .container { max-width: 400px; margin: 50px auto; background-color: #fff; border-radius: 10px; padding: 20px; } h2 { text-align: center; margin-bottom: 20px; } form { display: flex; flex-direction: column; } input[type="email"], input[type="password"], input[type="text"] { margin-bottom: 10px; padding: 10px; border-radius: 5px; border: none; outline: none; } button[type="submit"] { padding: 10px; border-radius: 5px; border: none; outline: none; background-color: #4CAF50; color: #fff; cursor: pointer; } button[type="submit"]:hover { background-color: #3e8e41; } ``` JS模板: ``` const loginForm = document.getElementById("login-form"); const registerForm = document.getElementById("register-form"); document.getElementById("login-btn").addEventListener("click", function() { loginForm.style.display = "block"; registerForm.style.display = "none"; }); document.getElementById("register-btn").addEventListener("click", function() { loginForm.style.display = "none"; registerForm.style.display = "block"; }); ``` 这是一个简单的登录注册页面模板,您可以根据需求进行修改和完善。建议您学习HTMLCSS和JS的基本语法和用法,以便更好地实现您的需求。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值