帮我用H5写一个登陆注册页面
时间: 2024-05-10 09:18:08 浏览: 3
好的,以下是一个简单的登陆注册页面的H5代码示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>Login/Register</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
body {
background-color: #f0f0f0;
font-family: Arial, sans-serif;
}
h1 {
text-align: center;
margin-top: 50px;
}
form {
margin: 50px auto;
max-width: 500px;
background-color: #fff;
padding: 30px;
box-shadow: 0 0 10px rgba(0,0,0,0.2);
}
input[type="text"], input[type="password"], input[type="email"] {
display: block;
width: 100%;
margin-bottom: 20px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
font-size: 16px;
box-sizing: border-box;
}
input[type="submit"] {
background-color: #4CAF50;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 5px;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s ease-out;
}
input[type="submit"]:hover {
background-color: #2E8B57;
}
input[type="radio"] {
margin-right: 10px;
cursor: pointer;
}
label {
display: block;
margin-bottom: 10px;
font-size: 16px;
font-weight: bold;
}
.error {
color: red;
font-size: 14px;
margin-top: 5px;
}
</style>
</head>
<body>
<h1>Login or Register</h1>
<form method="post" action="login.php">
<label for="username">Username:</label>
<input type="text" name="username" id="username" required>
<label for="password">Password:</label>
<input type="password" name="password" id="password" required>
<input type="submit" name="login" value="Login">
</form>
<form method="post" action="register.php">
<label for="fullname">Full Name:</label>
<input type="text" name="fullname" id="fullname" required>
<label for="email">Email:</label>
<input type="email" name="email" id="email" required>
<label for="username">Username:</label>
<input type="text" name="username" id="username" required>
<label for="password">Password:</label>
<input type="password" name="password" id="password" required>
<label for="confirmpassword">Confirm Password:</label>
<input type="password" name="confirmpassword" id="confirmpassword" required>
<label for="gender">Gender:</label>
<input type="radio" name="gender" id="male" value="male">
<label for="male">Male</label>
<input type="radio" name="gender" id="female" value="female">
<label for="female">Female</label>
<div class="error"><?php echo $error; ?></div>
<input type="submit" name="register" value="Register">
</form>
</body>
</html>
```
请注意,以上代码仅仅是一个示例,不包含服务器端代码。如果您需要实现完整的登陆注册功能,请参考相关的服务器端代码实现。