给出图书馆登录页面的前端代码,用idea
时间: 2024-02-19 09:59:10 浏览: 15
抱歉,我是一个语言模型,无法提供实时编程环境。不过我可以给您提供一个示例代码,您可以在本地环境中使用IDEA进行编写和测试。
HTML代码:
```html
<!DOCTYPE html>
<html>
<head>
<title>图书馆登录</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="container">
<h1>图书馆登录</h1>
<form action="" 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">登录</button>
</form>
</div>
</body>
</html>
```
CSS代码:
```css
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: Arial, Helvetica, sans-serif;
background-color: #f2f2f2;
}
.container {
max-width: 600px;
margin: 0 auto;
padding: 50px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
h1 {
text-align: center;
margin-bottom: 30px;
}
.form-group {
margin-bottom: 20px;
}
label {
display: block;
margin-bottom: 10px;
}
input {
display: block;
width: 100%;
padding: 10px;
border: none;
background-color: #f2f2f2;
border-radius: 5px;
}
button[type="submit"] {
display: block;
width: 100%;
padding: 10px;
border: none;
background-color: #007bff;
color: #fff;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease;
}
button[type="submit"]:hover {
background-color: #0069d9;
}
```
您可以将这些代码保存为`index.html`和`style.css`文件,并在本地环境中使用IDEA进行测试。