用html生成一个登录页面,居中显示“请输入用户信息”,要求输入用户名和密码且居中显示,最后登录按钮居中显示
时间: 2023-11-26 20:06:41 浏览: 28
以下是一个简单的登录页面的 HTML 代码,满足您的需求。在这个页面中,“请输入用户信息”文本、用户名和密码输入框和登录按钮都已经居中显示。
```html
<!DOCTYPE html>
<html>
<head>
<title>Login Page</title>
<style>
body {
background-color: #f2f2f2;
font-family: Arial, sans-serif;
}
.container {
width: 400px;
margin: 0 auto;
padding-top: 100px;
}
h2 {
text-align: center;
}
form {
background-color: white;
padding: 20px;
border-radius: 5px;
box-shadow: 0px 0px 10px #ccc;
}
input[type="text"], input[type="password"] {
width: 100%;
padding: 10px;
margin-bottom: 20px;
border: none;
border-radius: 3px;
box-shadow: 0px 0px 5px #ccc;
box-sizing: border-box;
font-size: 16px;
}
input[type="submit"] {
display: block;
margin: 0 auto;
padding: 10px 20px;
background-color: #4CAF50;
border: none;
border-radius: 3px;
color: white;
font-size: 16px;
cursor: pointer;
}
</style>
</head>
<body>
<div class="container">
<h2>请输入用户信息</h2>
<form>
<input type="text" name="username" placeholder="用户名">
<input type="password" name="password" placeholder="密码">
<input type="submit" value="登录">
</form>
</div>
</body>
</html>
```
您可以将这段代码保存为一个名为“login.html”的文件,然后在浏览器中打开它,就可以看到一个简单的登录页面了。