HTML写一个简单的登录注册界面

页面样式

 HTML代码

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Login</title>
</head>
<body>
<div class="box">
    <div class="login_box">
        <form action="#" method="post" class="from_box">
            <h1>Login</h1>
            <div class="box">
                <p><input class="login_account" type="email" name="Account" placeholder="Account"></p>
                <p><input class="login_account" type="email" name="Password" placeholder="Password"></p>
                <p>
                    <input class="login_login" type="submit" value="登录">
                    <input class="login_login" type="submit" value="注册">
                </p>
                <p class="login_login_p">---版权信息---</p>
            </div>
        </form>
    </div>
</div>
</body>
</html>

CSS代码

<style type="text/css">
        .login_box {
            border-radius: 10px;/*设置盒子的圆角*/
            margin: 0 auto;/*设置盒子居中*/
            text-align: center;/*内容居中*/
            width: 400px;
            height: 600px;
            background-color: lightblue;
        }
        h1 {
            caret-color: transparent;/*不显示光标*/
            width: 400px;
            height: 60px;
            background-color: darkorange;
            border-radius: 10px 10px 0 0;
        }
        .login_login {
            width: 180px;
            height: 40px;
            border-radius: 5px;/*设置盒子的圆角*/
            background-color: lightpink;
            border: 0;
        }
        .login_login:hover {
            background-color: pink;
        }
        .box {
            margin-top: 70px;/*盒子距离顶部的距离,以像素为单位*/
            border-radius: 10px;/*设置盒子的圆角*/
        }
        .login_account {
            width: 360px;
            height: 40px;
            border-radius: 5px;/*设置盒子的圆角*/
            border: 0;
        }
        .login_login_p {
            width: 110px;
            margin: 0 auto;/*设置盒子居中*/
        }
        .from_box {
            height: 600px;
            border-radius: 10px;/*设置盒子的圆角*/
        }
    </style>

完整代码

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Login</title>
    <style type="text/css">
        .login_box {
            border-radius: 10px;/*设置盒子的圆角*/
            margin: 0 auto;/*设置盒子居中*/
            text-align: center;/*内容居中*/
            width: 400px;
            height: 600px;
            background-color: lightblue;
        }
        h1 {
            caret-color: transparent;/*不显示光标*/
            width: 400px;
            height: 60px;
            background-color: darkorange;
            border-radius: 10px 10px 0 0;
        }
        .login_login {
            width: 180px;
            height: 40px;
            border-radius: 5px;/*设置盒子的圆角*/
            background-color: lightpink;
            border: 0;
        }
        .login_login:hover {
            background-color: pink;
        }
        .box {
            margin-top: 70px;/*盒子距离顶部的距离,以像素为单位*/
            border-radius: 10px;/*设置盒子的圆角*/
        }
        .login_account {
            width: 360px;
            height: 40px;
            border-radius: 5px;/*设置盒子的圆角*/
            border: 0;
        }
        .login_login_p {
            width: 110px;
            margin: 0 auto;/*设置盒子居中*/
        }
        .from_box {
            height: 600px;
            border-radius: 10px;/*设置盒子的圆角*/
        }
    </style>
</head>
<body>
<div class="box">
    <div class="login_box">
        <form action="#" method="post" class="from_box">
            <h1>Login</h1>
            <div class="box">
                <p><input class="login_account" type="email" name="Account" placeholder="Account"></p>
                <p><input class="login_account" type="email" name="Password" placeholder="Password"></p>
                <p>
                    <input class="login_login" type="submit" value="登录">
                    <input class="login_login" type="submit" value="注册">
                </p>
                <p class="login_login_p">---版权信息---</p>
            </div>
        </form>
    </div>
</div>
</body>
</html>

希望对你们有所帮助,再此感谢各位读者的支持,再次感谢!!! 

  • 9
    点赞
  • 79
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
HTML简单登录注册界面源代码如下: ```html <!DOCTYPE html> <html> <head> <title>登录/注册界面</title> <style> body { font-family: Arial, sans-serif; } .container { width: 300px; margin: 0 auto; padding: 20px; } .form-group { margin-bottom: 20px; } .form-group label { display: block; margin-bottom: 5px; } .form-group input[type="text"], .form-group input[type="password"] { width: 100%; padding: 5px; } .form-group .btn { display: block; width: 100%; padding: 10px; background-color: #4CAF50; color: white; border: none; cursor: pointer; } </style> </head> <body> <div class="container"> <h2>登录</h2> <form action="login.php" method="POST"> <div class="form-group"> <label for="username">用户名:</label> <input type="text" id="username" name="username" required> </div> <div class="form-group"> <label for="password">密码:</label> <input type="password" id="password" name="password" required> </div> <button type="submit" class="btn">登录</button> </form> <hr> <h2>注册</h2> <form action="register.php" method="POST"> <div class="form-group"> <label for="new-username">用户名:</label> <input type="text" id="new-username" name="new-username" required> </div> <div class="form-group"> <label for="new-password">密码:</label> <input type="password" id="new-password" name="new-password" required> </div> <button type="submit" class="btn">注册</button> </form> </div> </body> </html> ``` 这段代码展示了一个简单的登录/注册界面。其中包含两个表单,分别用于登录和注册功能。用户可以输入用户名和密码进行登录,也可以注册新的用户名和密码。登录和注册表单均使用POST方法提交到相应的处理程序(`login.php`和`register.php`)。使用CSS样式对界面进行简单的美化,包括边距、边框、背景等。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

□_□□_□

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

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

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

打赏作者

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

抵扣说明:

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

余额充值