html登录注册页面代码
时间: 2023-07-06 07:02:42 浏览: 91
下面是一个简单的HTML登录注册页面的代码示例:
```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>登录/注册</title>
<style>
body {
font-family: Arial, sans-serif;
}
form {
max-width: 300px;
margin: 0 auto;
}
input {
display: block;
width: 100%;
margin-bottom: 10px;
}
button {
width: 100%;
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
cursor: pointer;
}
</style>
</head>
<body>
<h1>登录</h1>
<form action="login.php" method="POST">
<input type="text" name="username" placeholder="用户名" required>
<input type="password" name="password" placeholder="密码" required>
<button type="submit">登录</button>
</form>
<h1>注册</h1>
<form action="register.php" method="POST">
<input type="text" name="username" placeholder="用户名" required>
<input type="email" name="email" placeholder="邮箱" required>
<input type="password" name="password" placeholder="密码" required>
<button type="submit">注册</button>
</form>
</body>
</html>
```
上述代码是一个简单的HTML页面,其中包含了一个登录表单和一个注册表单。登录表单用于接收用户名和密码,注册表单用于接收用户名、邮箱和密码。用户在输入框中输入相应的信息,并点击提交按钮进行登录或注册操作。登录表单的action属性指定了登录表单提交的URL(如login.php),注册表单的action属性指定了注册表单提交的URL(如register.php)。