用django写一个html文件,内容包含用户名、密码和提交按钮,位置居中,背景设置成蓝紫色
时间: 2023-05-20 07:04:19 浏览: 81
以下是使用 Django 编写的 HTML 文件,其中包含用户名、密码和提交按钮,位置居中,背景设置为蓝紫色:
```html
<!DOCTYPE html>
<html>
<head>
<title>Login Page</title>
<style>
body {
background-color: #8A2BE2;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
}
.form {
background-color: #fff;
padding: 20px;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
}
.form input[type="text"],
.form input[type="password"] {
padding: 10px;
margin-bottom: 10px;
border-radius: 5px;
border: none;
width: 100%;
box-sizing: border-box;
}
.form input[type="submit"] {
background-color: #4CAF50;
color: #fff;
padding: 10px;
border: none;
border-radius: 5px;
cursor: pointer;
width: 100%;
box-sizing: border-box;
}
</style>
</head>
<body>
<div class="container">
<form class="form" method="post">
<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>
<input type="submit" value="Submit">
</form>
</div>
</body>
</html>
```
阅读全文