写一段html登录界面代码
时间: 2023-05-26 21:04:18 浏览: 44
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Login</title>
<style>
body {
font-family: Arial, Helvetica, sans-serif;
background-color: #ddd;
}
#loginForm {
width: 30%;
margin: 0 auto;
border: 1px solid #ccc;
background-color: #fff;
padding: 20px;
}
label {
display: block;
margin-bottom: 10px;
font-weight: bold;
}
input[type="text"], input[type="password"] {
width: 100%;
padding: 5px;
margin-bottom: 20px;
border-radius: 5px;
border: 2px solid #ccc;
}
input[type="submit"] {
background-color: #4CAF50;
color: white;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #45a049;
}
</style>
</head>
<body>
<div id="loginForm">
<h1>Login</h1>
<form action="login.php" 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>