【Web】HTML 账号注册页面

使用CSS的选择器功能美化账号注册界面

HTML代码

<!doctype html>
<html>
<head>
<title>sign in</title>
<style>
div{
    background:#009FCC;
    font-size:24px;
    padding:5px;
    color:white;
}
form{
    background: #F8F8FF ;
    border:#357FC4 solid 1px;
    color:#575454;  
    width:400px;
    margin:20px auto;
    font-size:15px;
}
table{
    margin:10px auto;
}
a{
    text-decoration:none;
}
input[type="button"]{
    background:#228B22;
    color:white;
    font-size:15px;
    font-weight:bold;
    width:120px;
    height:40px;
}
td:first-child{
    text-align:right;
    padding:0 5px;
}
td:only-child{
    text-align:center;
    font-size:12px;
}
span:before{
    content:"* ";
    color:red;
}
input[type="text"]:read-only{
    border:#888484 solid 2px;
    background:#888484;
    font-weight:bold;   
}
input[type="text"]:hover{
    background:#EFD9AC;
}
</style>
</head>
<body>
<form>
<div>注册账号</div>
<table>
    <tr><td><span>用户名</span></td><td><input type="text" name="user_name" /></td></tr>
    <tr><td><span>email</span></td><td><input type="text" name="user_email" /></td></tr>
    <tr><td><span>密码</span></td><td><input type="password" name="user_password" /></td></tr>
    <tr><td><span>确认密码</span></td><td><input type="password" name="user_confirm_password" /></td></tr>   
    <tr><td>性别</td><td><input type="radio" id="male" name="user_sex" checked /><input type="radio" id="female" name="user_sex" /></td></tr>
    <tr><td>手机号码</td><td><input type="text" name="user_phone1" /></td></tr>
    <tr><td colspan="2"><input type="checkbox" checked/>我已看过并接受<a href="#">《用户协议》</a></td></tr>
    <tr><td colspan="2"><input type="button" name="submit" value="立即注册" /></td></tr>
</table>
</form>
</body>
</html>

web页面效果图

这里写图片描述

以下是一个简单的HTML登录注册页面代码示例: ```html <!DOCTYPE html> <html> <head> <title>登录注册页面</title> <meta charset="utf-8"> <style type="text/css"> form { margin: 50px auto; padding: 20px; border: 1px solid #ccc; width: 300px; text-align: center; } input[type=text], input[type=password] { padding: 10px; margin: 10px 0; display: block; width: 100%; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; } input[type=submit] { padding: 10px; background-color: #4CAF50; color: white; border: none; border-radius: 5px; cursor: pointer; } </style> </head> <body> <h1>欢迎来到登录注册页面</h1> <form action="" method="post"> <h2>登录</h2> <label for="login-username">用户名:</label> <input type="text" id="login-username" name="login-username" required> <label for="login-password">密码:</label> <input type="password" id="login-password" name="login-password" required> <input type="submit" value="登录"> </form> <form action="" method="post"> <h2>注册</h2> <label for="register-username">用户名:</label> <input type="text" id="register-username" name="register-username" required> <label for="register-password">密码:</label> <input type="password" id="register-password" name="register-password" required> <input type="submit" value="注册"> </form> </body> </html> ``` 请注意,这只是一个简单的示例,实际的登录注册页面可能会更加复杂,具体取决于您的需求。此外,此示例中的表单动作为空,您需要将其替换为实际的后端处理程序。
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值