HTML+CSS做登录注册界面

11 篇文章 0 订阅

在登录界面点注册会进入注册界面

登录界面代码:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>
        <div style="width:500px;float: right;margin:0 auto;" >
         <label for="username" style="font-size:18px" >用户名:</label>
         <div style="height:35px;width:400px;position:relative;display:inline" >   <!--相关位置--> <!--此处为相关位置与绝对位置联合使用-->
             <input id="username" type="text" style="height:30px;width:350px;padding-right:50px;">
             <span style="position:absolute;right:18px;top:2px;background-image:url(user.ico);height:16px;width:16px;display:inline-block;"></span>  <!--绝对位置-->
         </div>
         <br/>
         <br/>
         <label for="password1" style="font-size:18px" >&nbsp密码:</label>
         <div style="height:35px;width:400px;position:relative;display:inline" >   <!--相关位置--> <!--此处为相关位置与绝对位置联合使用-->
             <input id="password1" type="text" style="height:30px;width:350px;padding-right:50px;">
             <span style="position:absolute;right:16px;top:2px;background-image:url(p.ico);height:16px;width:16px;display:inline-block;"></span>  <!--绝对位置-->
         </div>
         <br/>
         <br/>
         <label for="verification_code" style="font-size:18px" >验证码:</label>
         <input id="verification_code" type="text" style="height:30px;width:350px;">
         <br/>
         <br/>
         <div style="width:426px;float: right;">
             <input type="radio" name="auto_login" value="1"/> 自动登录
             <a herf="找回密码网址">忘记密码?</a>
             <a href="http://localhost:63342/jichu/day16/注册.html?_ijt=eb8klk8d781ojsf5e8eb7tjf41">注册</a>
         </div>
         <br/>
         <br/>
         <div style="width:426px;float: right;">
             <input type="submit" value="登录" style="height:30px;width:400px;background-color:red;"/>
         </div>
     </div>

</body>
</html>

注册界面代码:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .p{
            color:red;
            margin-left:20px;
            display:inline-block;
        }
        .c{
            color:red;
            margin-left:4px;
            display:inline-block;
        }
        .l{
            font-size:18px;
        }
        .d{
            height:35px;
            width:300px;
            display:inline;
        }
        .i{
            height:30px;
            width:300px;
        }


    </style>
</head>
<body>
    <div style="height:80px;"></div>
    <form enctype="multipart/form-data">
        <div style="width:500px;float:left;margin:0 20px;">
            <div style="font-size:28px;">注册新用户</div>
            <br/>
            <span class="p">*</span>
            <label for="username" class="l">用户名:</label>
            <div style="height:35px;width:300px;position:relative;display:inline;">
                <input id="username" type="text" style="height:30px;width:250px;padding-right:50px;">
                <span style="position:absolute;right:18px;top:2px;background-image:url(user.ico);height:16px;width:16px;display:inline-block;" ></span>
            </div>
            <br/><br/>
            <span class="p">*</span>
            <label for="phonenumber" class="l">手机号:</label>
            <div  class="d">
                <input id="phonenumber" type="text" class="i">
            </div>
            <br/><br/>
            <span class="c">*</span>
            <label for="login_password" class="l">登录密码:</label>
            <div  class="d">
                <input id="login_password" type="text" class="i">
            </div>
            <br/><br/>
            <span class="c">*</span>
            <label for="confirm_password" class="l">确认密码:</label>
            <div  class="d">
                <input id="confirm_password" type="text" class="i">
            </div>
            <br/><br/>
            <span class="p">*</span>
            <label for="ver_code" class="l">验证码:</label>
            <div  class="d">
                <input id="ver_code" type="text" class="i">
            </div>
            <br/><br/>
            <input type="checkbox" name="agree" style="margin-left:100px;display:inline-block;" value="1"/>
            <span style="font-size:10px;">我已阅读并同意《用户注册协议》</span>
            <br/><br/>
            <input type="submit" value="同意以上协议并注册" style="margin-left:100px;height:30px;width:300px;background-color:red;display:inline-block;"/>
        </div>
    </form>

</body>
</html>

登录界面效果:


注册界面效果:



  • 74
    点赞
  • 457
    收藏
    觉得还不错? 一键收藏
  • 8
    评论
以下是一个简单的HTML+CSS登录注册页面的示例: ```html <!DOCTYPE html> <html> <head> <title>Login/Register Page</title> <style> body { font-family: Arial, sans-serif; background-color: #f2f2f2; } .container { max-width: 400px; margin: 0 auto; padding: 20px; background-color: #fff; border-radius: 5px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } h2 { text-align: center; } .form-group { margin-bottom: 20px; } .form-group label { display: block; font-weight: bold; margin-bottom: 5px; } .form-group input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 3px; } .form-group button { width: 100%; padding: 10px; background-color: #4CAF50; color: #fff; border: none; border-radius: 3px; cursor: pointer; } .form-group button:hover { background-color: #45a049; } </style> </head> <body> <div class="container"> <h2>Login</h2> <form> <div class="form-group"> <label for="username">Username:</label> <input type="text" id="username" name="username" required> </div> <div class="form-group"> <label for="password">Password:</label> <input type="password" id="password" name="password" required> </div> <div class="form-group"> <button type="submit">Login</button> </div> </form> <p>Don't have an account? <a href="#">Register</a></p> </div> </body> </html> ``` 这是一个简单的登录页面,包含一个用户名输入框、密码输入框和登录按钮。用户可以在输入框中输入用户名和密码,然后点击登录按钮进行登录操作。如果用户没有账号,可以点击页面底部的"Register"链接进行注册。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值