用html写一个好看的登录页面
时间: 2023-09-12 11:10:05 浏览: 41
好的,以下是一个简单但好看的登录页面的HTML代码,您可以根据自己的需要进行修改:
```html
<!DOCTYPE html>
<html>
<head>
<title>Login Page</title>
<style type="text/css">
body {
background-color: #f2f2f2;
}
form {
background-color: #fff;
border-radius: 5px;
padding: 20px;
width: 300px;
margin: 50px auto;
}
input[type="text"], input[type="password"] {
width: 100%;
padding: 10px;
margin-bottom: 20px;
border: none;
border-bottom: 2px solid #ccc;
font-size: 16px;
font-family: Arial, sans-serif;
}
input[type="submit"] {
background-color: #4CAF50;
color: #fff;
border: none;
padding: 10px 20px;
border-radius: 5px;
font-size: 16px;
font-weight: bold;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #3e8e41;
}
.error-message {
color: #ff0000;
font-size: 14px;
margin-bottom: 10px;
}
</style>
</head>
<body>
<form>
<h1>Login</h1>
<div class="error-message"></div>
<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="Login">
</form>
</body>
</html>
```