html简单登录注册界面源代码
时间: 2023-08-09 19:00:39 浏览: 77
HTML简单登录注册界面源代码如下:
```html
<!DOCTYPE html>
<html>
<head>
<title>登录/注册界面</title>
<style>
body {
font-family: Arial, sans-serif;
}
.container {
width: 300px;
margin: 0 auto;
padding: 20px;
}
.form-group {
margin-bottom: 20px;
}
.form-group label {
display: block;
margin-bottom: 5px;
}
.form-group input[type="text"],
.form-group input[type="password"] {
width: 100%;
padding: 5px;
}
.form-group .btn {
display: block;
width: 100%;
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
cursor: pointer;
}
</style>
</head>
<body>
<div class="container">
<h2>登录</h2>
<form action="login.php" method="POST">
<div class="form-group">
<label for="username">用户名:</label>
<input type="text" id="username" name="username" required>
</div>
<div class="form-group">
<label for="password">密码:</label>
<input type="password" id="password" name="password" required>
</div>
<button type="submit" class="btn">登录</button>
</form>
<hr>
<h2>注册</h2>
<form action="register.php" method="POST">
<div class="form-group">
<label for="new-username">用户名:</label>
<input type="text" id="new-username" name="new-username" required>
</div>
<div class="form-group">
<label for="new-password">密码:</label>
<input type="password" id="new-password" name="new-password" required>
</div>
<button type="submit" class="btn">注册</button>
</form>
</div>
</body>
</html>
```
这段代码展示了一个简单的登录/注册界面。其中包含两个表单,分别用于登录和注册功能。用户可以输入用户名和密码进行登录,也可以注册新的用户名和密码。登录和注册表单均使用POST方法提交到相应的处理程序(`login.php`和`register.php`)。使用CSS样式对界面进行简单的美化,包括边距、边框、背景等。