请帮我写一个HTML登录界面,要求有一个登录界面的标识,还有和输入账号密码的文本框,显示在页面中央
时间: 2024-03-24 13:37:46 浏览: 18
好的,以下是一个简单的HTML登录界面代码,实现了你的要求:
```html
<!DOCTYPE html>
<html>
<head>
<title>Login Page</title>
<style>
/* 居中样式 */
body {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
/* 登录框样式 */
.login-box {
background-color: #f2f2f2;
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
text-align: center;
}
/* 输入框样式 */
input[type=text], input[type=password] {
padding: 10px;
margin: 10px 0;
border: none;
border-radius: 3px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
width: 100%;
font-size: 16px;
}
/* 登录按钮样式 */
input[type=submit] {
background-color: #4CAF50;
color: white;
padding: 10px;
border: none;
border-radius: 3px;
cursor: pointer;
width: 100%;
font-size: 16px;
}
</style>
</head>
<body>
<div class="login-box">
<h2>Login</h2>
<form>
<input type="text" placeholder="Username" name="username" required>
<input type="password" placeholder="Password" name="password" required>
<input type="submit" value="Login">
</form>
</div>
</body>
</html>
```
这个登录界面采用了 flex 布局居中,登录框使用了圆角和阴影,输入框和登录按钮都添加了样式。你可以根据需要进行修改。