HTML登录注册页面代码
时间: 2024-06-11 18:03:36 浏览: 23
HTML是超文本标记语言,用于创建网页的结构和内容。创建一个简单的登录和注册页面,你需要使用HTML的基本标签和表单元素。以下是一个基础的示例,展示了如何构建登录和注册表格:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Login and Registration</title>
<style>
/* 可选:添加一些基本样式 */
form {
width: 300px;
margin: auto;
padding: 20px;
}
input, select {
display: block;
margin-bottom: 10px;
padding: 5px;
}
button {
width: 100%;
background-color: #4CAF50;
color: white;
border: none;
}
</style>
</head>
<body>
<!-- 登录表单 -->
<h2>Login</h2>
<form action="/login" method="POST">
<label for="username">Username:</label>
<input type="text" id="username" name="username" required><br>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required><br>
<button type="submit">Login</button>
</form>
<!-- 注册表单 -->
<h2>Register</h2>
<form action="/register" method="POST">
<label for="reg_username">Username:</label>
<input type="text" id="reg_username" name="reg_username" required><br>
<label for="reg_email">Email:</label>
<input type="email" id="reg_email" name="reg_email" required><br>
<label for="reg_password">Password:</label>
<input type="password" id="reg_password" name="reg_password" required><br>
<button type="submit">Register</button>
</form>
</body>
</html>
```
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)