๐ Simple Login Form
A login form is one of the most common elements in web development. It allows users to enter their credentials (username and password) to access a system. The form usually includes input fields, a submit button, and some styling to make it user-friendly. Below is a clean example with HTML and CSS.
๐ป Code Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>User Login</title>
<style>
body {
font-family: Arial, sans-serif;
background: #e9ecef;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.login-container {
background: #fff;
padding: 25px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
width: 320px;
}
.login-container h2 {
text-align: center;
margin-bottom: 15px;
color: #333;
}
.login-container p {
text-align: center;
font-size: 14px;
color: #666;
margin-bottom: 20px;
}
.login-container input {
width: 100%;
padding: 10px;
margin: 8px 0;
border: 1px solid #ccc;
border-radius: 5px;
}
.login-container button {
width: 100%;
padding: 10px;
background: #28a745;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
}
.login-container button:hover {
background: #218838;
}
</style>
</head>
<body>
<div class="login-container">
<h2>User Login</h2>
<p>Please enter your username and password to continue.</p>
<form>
<input type="text" placeholder="Username" required>
<input type="password" placeholder="Password" required>
<button type="submit">Login</button>
</form>
</div>
</body>
</html>