生成一个简易表单含账号密码和登录注册界面
时间: 2023-07-18 09:28:08 浏览: 53
这里给你一个简易的HTML代码示例,包含账号密码输入框和登录/注册按钮。你可以根据需要进行修改和美化。
```
<!DOCTYPE html>
<html>
<head>
<title>Login/Register Form</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
form {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 50px;
}
input[type=text], input[type=password] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
button[type=submit] {
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
}
button[type=submit]:hover {
background-color: #45a049;
}
</style>
</head>
<body>
<form action="login.php" method="post">
<h2>Login</h2>
<label for="username"><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="username" required>
<label for="password"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="password" required>
<button type="submit">Login</button>
</form>
<form action="register.php" method="post">
<h2>Register</h2>
<label for="username"><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="username" required>
<label for="password"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="password" required>
<button type="submit">Register</button>
</form>
</body>
</html>
```
这是一个基础的HTML表单,如果你需要在后台进行账号密码验证和注册等操作,需要编写相应的PHP或其他服务器端脚本。