帮我生成一个登录页面
时间: 2024-02-21 12:58:27 浏览: 13
好的,以下是一个简单的登录页面的 HTML 和 CSS 代码:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Login Page</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f1f1f1;
}
.container {
background-color: #ffffff;
margin: 150px auto;
border-radius: 5px;
box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.2);
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;
border-radius: 4px;
box-sizing: border-box;
}
button {
background-color: #4caf50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
width: 100%;
}
button:hover {
background-color: #45a049;
}
</style>
</head>
<body>
<div class="container">
<h2>Login Form</h2>
<form>
<label for="username">Username</label>
<input type="text" id="username" name="username" required />
<label for="password">Password</label>
<input type="password" id="password" name="password" required />
<button type="submit">Login</button>
</form>
</div>
</body>
</html>
```
你可以将上面的代码保存为一个 HTML 文件,然后用浏览器打开,就可以看到一个简单的登录页面了。