登录注册及登录状态的判断界面html源代码
时间: 2023-11-24 18:07:07 浏览: 21
当然可以!以下是一个简单的登录注册界面的HTML源代码示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>Login and Registration</title>
<style>
form {
margin: 20px auto;
width: 300px;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
}
h2 {
text-align: center;
}
input[type=text], input[type=password] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
button {
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
}
.container {
padding: 16px;
}
.clearfix::after {
content: "";
clear: both;
display: table;
}
</style>
</head>
<body>
<h2>Login</h2>
<form action="/login" method="post">
<div class="container">
<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>
</div>
</form>
<h2>Registration</h2>
<form action="/register" method="post">
<div class="container">
<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>
</div>
</form>
</body>
</html>
```
这段代码包含了一个登录和一个注册表单,分别提交到`/login`和`/register`的URL。你可以根据需要修改和扩展这段代码以适应你的具体应用场景。