带有边框的用户登录界面html
时间: 2023-09-02 10:13:59 浏览: 29
可以使用以下代码实现一个带有边框的用户登录界面:
```html
<!DOCTYPE html>
<html>
<head>
<title>Login Form</title>
<style>
body {
background-color: #f1f1f1;
}
h2 {
text-align: center;
margin-top: 50px;
}
.container {
margin-left: auto;
margin-right: auto;
margin-top: 50px;
background-color: #fff;
border: 1px solid #ccc;
width: 400px;
padding: 20px;
}
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%;
}
button:hover {
opacity: 0.8;
}
</style>
</head>
<body>
<h2>Login Form</h2>
<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>
</body>
</html>
```
可以根据需要调整样式和布局。