写一个好看的html登录页面出来
时间: 2023-06-11 11:10:06 浏览: 38
以下是一个简单的HTML登录页面的示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>Login Page</title>
<style>
body {
background-color: #f2f2f2;
font-family: Arial, Helvetica, sans-serif;
}
.container {
margin: auto;
max-width: 400px;
padding: 20px;
background-color: #fff;
border-radius: 5px;
box-shadow: 0px 0px 10px #ccc;
text-align: center;
}
h1 {
color: #333;
text-align: center;
font-size: 28px;
margin-bottom: 20px;
}
input[type="text"], input[type="password"] {
width: 100%;
padding: 10px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
button {
background-color: #4CAF50;
color: #fff;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
width: 100%;
font-size: 18px;
}
button:hover {
background-color: #45a049;
}
</style>
</head>
<body>
<div class="container">
<h1>Login</h1>
<form>
<label for="username"><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="username" required>
<label for="password"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="password" required>
<button type="submit">Login</button>
</form>
</div>
</body>
</html>
```
这个页面使用了简单的CSS样式来使页面看起来更漂亮,其中包括:
- 设置了页面背景颜色和字体
- 创建了一个最大宽度为400px的容器,使表单居中显示
- 设置了标题样式
- 创建了文本框和按钮样式,并将其居中对齐
你可以根据自己的需求修改这个示例,添加更多的字段和样式。