
This is a modern and stylish login form using HTML and CSS, featuring 3D effects, colorful fields, and a button. The “Not registered? Create an account” text is included below the button with a link.
HTML Code for Login Form
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login Form</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="login-container">
<h2>Login</h2>
<form>
<div class="input-container">
<input type="text" id="username" name="username" required>
<label for="username">Username</label>
</div>
<div class="input-container">
<input type="password" id="password" name="password" required>
<label for="password">Password</label>
</div>
<button type="submit" class="login-btn">Login</button>
<p class="register-link">Not registered? <a href="#">Create an account</a></p>
</form>
</div>
</body>
</html>
CSS Code for Login Form
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background: linear-gradient(135deg, #f8b195, #f67280);
}
.login-container {
background: #fff;
padding: 30px 40px;
border-radius: 10px;
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
transform: perspective(1000px) rotateY(-10deg);
}
h2 {
margin-bottom: 20px;
color: #333;
text-align: center;
}
.input-container {
position: relative;
margin-bottom: 25px;
}
.input-container input {
width: 100%;
padding: 10px;
border: none;
border-bottom: 2px solid #ddd;
background: #f9f9f9;
border-radius: 5px;
outline: none;
transition: all 0.3s ease;
}
.input-container input:focus {
border-bottom: 2px solid #f67280;
background: #fff;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
.input-container label {
position: absolute;
top: 10px;
left: 10px;
pointer-events: none;
font-size: 14px;
color: #aaa;
transition: all 0.3s ease;
}
.input-container input:focus + label,
.input-container input:not(:placeholder-shown) + label {
top: -10px;
font-size: 12px;
color: #f67280;
}
.login-btn {
width: 100%;
padding: 10px 20px;
background: #f67280;
border: none;
border-radius: 5px;
color: #fff;
font-size: 16px;
cursor: pointer;
transition: background 0.3s ease;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
.login-btn:hover {
background: #c06c84;
}
.register-link {
margin-top: 15px;
text-align: center;
color: #555;
}
.register-link a {
color: #f67280;
text-decoration: none;
font-weight: bold;
transition: color 0.3s ease;
}
.register-link a:hover {
color: #c06c84;
}
Tags:
- Modern Login Form Design
- Stylish User Authentication
- Responsive Login Interface
- 3D Effect Login Form
- Colorful Login Fields and Button
Tags:
HTML
Login Form