编写一个html的登陆界面
时间: 2024-05-20 16:19:33 浏览: 11
<!DOCTYPE html>
<html>
<head>
<title>Login Page</title>
<style>
body {
background-color: #f2f2f2;
font-family: Arial, sans-serif;
}
.container {
margin: 50px auto;
width: 300px;
background-color: #fff;
padding: 20px;
border-radius: 5px;
box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}
h1 {
text-align: center;
color: #333;
}
label {
display: block;
margin-bottom: 5px;
color: #666;
}
input[type="text"],
input[type="password"] {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
margin-bottom: 20px;
box-sizing: border-box;
}
input[type="submit"] {
background-color: #4CAF50;
color: #fff;
padding: 10px;
border: none;
border-radius: 5px;
cursor: pointer;
width: 100%;
}
input[type="submit"]:hover {
background-color: #3e8e41;
}
</style>
</head>
<body>
<div class="container">
<h1>Login</h1>
<form action="#" method="post">
<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>
</div>
</body>
</html>