Advertisement

Create an HTML file and include a basic structure with a head and body tag.
You can use the following code as a starting point and Add the CSS files to your HTML document
HTML
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Responsive Login form using Html and CSS</title> <link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css"></head><body></body></html>
Inside the body tag, create a div element with a class of "login-container".
HTML
<div class="login-container"> <div class="container"> <h1>Login Form</h1> <div class="head"> <a href="#" class="login hover_btn">Login</a> <a href="#" class="signup">SignUp</a> </div> <input type="email" class="email" placeholder="Email Adress"> <input type="password" class="pass" placeholder="Pasword"> <div class="forget"> <a href="#" class="fgpass">Forgot Password</a> </div> <a href="#" class="login-button hover_btn">Login</a> <div class="sin_up"> <p class="member">Not A Member?</p> <a href="#" class="sign-now">SignUp Now</a> </div> </div></div>
Create a CSS file and style your Login form to make it look nice. You can use the following code as a starting point
CSS
body{ margin: 0; padding: 0; font-family: sans-serif;}.login-container{ height: 100vh; background: #a7c5e1; display: flex; justify-content: center; align-items: center;}.container{ width: 330px; height: 400px; border-radius: 8px; background-color: white; display: flex; flex-direction: column; justify-content: center; align-items: center; box-shadow: 0 4px 6px #0004;}input{ padding: 10px 36px; margin: 5px; width: 210px; outline-color: #0084ff;}.head{ margin-top: 20px; margin-bottom: 30px;}.login{ padding: 12px 46px; text-decoration: none; background: linear-gradient(to right,#2be2cd, #0297b8); color: white;}.pass{ margin-bottom: 10px;}.signup{ padding: 10px 46px; text-decoration: none; color: #0297b8; border: 2px solid #0297b8;}.fgpass{ display: block; text-decoration: none; color: #001c80; margin: 10px 0 0;}.login-button{ padding: 10px 120px; text-decoration: none; background: linear-gradient(to right,#2be2cd, #0297b8); color: white; border-radius: 5px; margin-top: 15px; margin-bottom: 15px;}.sin_up{ display: flex; align-items: center;}.member{ margin-right: 5px;}.sign-now{ text-decoration: none; color: #001c80;}
Save the file and open it in a web browser to see your Login form.