帮我写一个酒店管理登录页面
时间: 2023-03-03 08:54:54 浏览: 57
当然可以,以下是一个简单的酒店管理登录页面的示例代码,你可以根据需要进行修改和优化。
HTML 代码:
```html
<!DOCTYPE html>
<html>
<head>
<title>酒店管理系统 - 登录</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="login-container">
<h1>酒店管理系统</h1>
<form action="login.php" method="post">
<label for="username"><b>用户名</b></label>
<input type="text" placeholder="请输入用户名" name="username" required>
<label for="password"><b>密码</b></label>
<input type="password" placeholder="请输入密码" name="password" required>
<button type="submit">登录</button>
</form>
</div>
</body>
</html>
```
CSS 代码:
```css
/* 居中显示 */
.login-container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
/* 输入框样式 */
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[type=submit] {
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
}
button[type=submit]:hover {
opacity: 0.8;
}
```
在上述示例代码中,我们创建了一个包含一个简单表单的酒店管理登录页面。表单中包括用户名和密码输入框,以及一个登录按钮。输入框是必填的,并且在点击登录按钮时将提交表单到 `login.php` 处理登录逻辑。你可以根据需要修改表单的提交地址以及登录逻辑的处理方式。