html、js、css写一个登陆表单
时间: 2023-10-09 21:15:51 浏览: 18
<!DOCTYPE html>
<html>
<head>
<title>Login Form</title>
<style>
body {
background-color: #f2f2f2;
font-family: Arial, sans-serif;
}
form {
background-color: #fff;
padding: 20px;
width: 400px;
margin: 50px auto;
border-radius: 5px;
box-shadow: 0px 0px 10px #ccc;
}
h2 {
margin-top: 0px;
}
input[type="text"], input[type="password"] {
width: 100%;
padding: 10px;
margin: 10px 0;
border: none;
border-radius: 3px;
box-sizing: border-box;
}
input[type="submit"] {
background-color: #4CAF50;
color: #fff;
padding: 10px;
border: none;
border-radius: 3px;
cursor: pointer;
font-size: 18px;
width: 100%;
margin-top: 10px;
}
input[type="submit"]:hover {
background-color: #333;
}
</style>
</head>
<body>
<form action="#" method="post">
<h2>Login Form</h2>
<label for="username">Username:</label>
<input type="text" name="username" id="username" placeholder="Enter username" required>
<label for="password">Password:</label>
<input type="password" name="password" id="password" placeholder="Enter password" required>
<input type="submit" value="Login">
</form>
</body>
</html>