给我一个美丽的登录页面html代码
时间: 2023-12-22 09:38:56 浏览: 23
以下是一个简单且美观的登录页面的HTML代码示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>登录页面</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f2f2f2;
margin: 0;
padding: 0;
}
.container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.login-box {
background-color: #fff;
width: 300px;
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.login-box h2 {
text-align: center;
margin-bottom: 20px;
}
.login-box input[type="text"],
.login-box input[type="password"] {
width: 100%;
padding: 10px;
margin-bottom: 15px;
border: 1px solid #ccc;
border-radius: 3px;
}
.login-box input[type="submit"] {
width: 100%;
padding: 10px;
background-color: #4caf50;
border: none;
color: #fff;
cursor: pointer;
}
.login-box input[type="submit"]:hover {
background-color: #45a049;
}
.login-box p {
text-align: center;
margin-top: 10px;
}
</style>
</head>
<body>
<div class="container">
<div class="login-box">
<h2>登录</h2>
<form>
<input type="text" placeholder="用户名" required>
<input type="password" placeholder="密码" required>
<input type="submit" value="登录">
</form>
<p>还没有账号?<a href="#">注册</a></p>
</div>
</div>
</body>
</html>
```
你可以将上述代码保存为一个`.html`文件,然后在浏览器中打开该文件,即可看到一个简单而美观的登录页面。