html登录注册页面代码
时间: 2023-08-09 07:12:15 浏览: 31
以下是一个简单的 HTML 登录注册页面的代码示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>登录/注册页面</title>
</head>
<body>
<h1>欢迎来到我的网站</h1>
<h2>登录</h2>
<form>
<label for="username">用户名:</label>
<input type="text" id="username" name="username"><br>
<label for="password">密码:</label>
<input type="password" id="password" name="password"><br>
<input type="submit" value="登录">
</form>
<hr>
<h2>注册</h2>
<form>
<label for="new-username">用户名:</label>
<input type="text" id="new-username" name="new-username"><br>
<label for="new-password">密码:</label>
<input type="password" id="new-password" name="new-password"><br>
<label for="confirm-password">确认密码:</label>
<input type="password" id="confirm-password" name="confirm-password"><br>
<input type="submit" value="注册">
</form>
</body>
</html>
```
这段代码包含两个表单,一个是登录表单,另一个是注册表单。在登录表单中,用户需要输入用户名和密码,然后点击“登录”按钮。在注册表单中,用户需要输入新的用户名和密码,并确认密码,然后点击“注册”按钮。在实际应用中,还需要添加后端代码来验证用户的输入并执行相应的操作,如登录或注册。