HTML代码。

<!DOCTYPE html>
<html>
<head>
<title>注册和登录页面</title>
<style>
.container {
margin-top: 50px;
}
</style>
</head>
<body>
<div class="container">
<h2>注册</h2>
<form action="/register" method="post">
<div>
<label for="username">用户名:</label>
<input type="text" id="username" name="username" required>
</div>
<div>
<label for="password">密码:</label>
<input type="password" id="password" name="password" required>
</div>
<button type="submit">注册</button>
</form>
</div>
<div class="container">
<h2>登录</h2>
<form action="/login" method="post">
<div>
<label for="username">用户名:</label>
<input type="text" id="username" name="username" required>
</div>
<div>
<label for="password">密码:</label>
<input type="password" id="password" name="password" required>
</div>
<button type="submit">登录</button>
</form>
</div>
</body>
</html>这个页面包含两个表单,一个用于注册,一个用于登录,表单的action属性指向处理这些请求的后端URL(例如/register和/login),而method属性设置为post,用于提交表单数据,每个表单都有两个输入字段:一个用于用户名,一个用于密码,这两个字段都是必需的,所以设置了required属性,提交按钮使用type="submit"来提交表单,这只是一个基本的示例,实际的注册和登录过程需要更多的验证和安全措施。






