Personification is a major feature of most of all the web page these days. A user can create a profile and login to his profile and see the personalized items. All this requires a signup form where user can create account and a css login form from where user can enter login credentials and use the account. This html css login tutorial teaches you how to create a beautiful login screen page using HTML and CSS only and also includes two login page design template css example.
A login form generally consists of a username or email field, a password field and a bottom for logging in. Some of the login page may also include captcha which helps to prevent automated login attempts.
The login process generally deals with 2 major items: username and password. When a user enters username and password in respective field and clicks on login button, the credentials are checked in database and promoted accordingly. In case the credential combination is correct, the user will be able to log in else not. We can also implement 2 step authentication in login where after successfully entering username and password, user will go through another step of verification.
Another step might include OTP (One Time Password) which is sent in email or phone or answering security questions. So, basically, a login form is a record form whose insert, update and delete properties have been disabled.
Learn To Make Login Form Page Design with HTML and CSS
In this
login form css tutorial
we will create two beautiful login page using only HTML and CSS with an example.
First login page
will consist of a simple login page with centralized login form.
Second login page
will consist of two section, left and right. Left part will consists of login form along with social icons and right part will consist of small textual content.
Simple HTML CSS Login
Form
This login form has a beautiful design with a login form at center of the page and background with gradient. It is created using pure HTML and CSS only.

In this part, we are creating a very simple user interface of login form. Here we will create a CSS login form with a centralized form and not much options. These forms are usually suitable for admin login panel or sophisticated user login panel.
Here is the complete login template html css.
HTML Code
<!DOCTYPE html> <html> <head> <link rel="stylesheet" href="style.css"> <title> CSS Login Screen Tutorial </title> </head> <body> <body> <div class="login-page"> <div class="form"> <div class="login"> <div class="login-header"> <h3>LOGIN</h3> <p>Please enter your credentials to login.</p> </div> </div> <form class="login-form"> <input type="text" placeholder="username"/> <input type="password" placeholder="password"/> <button>login</button> <p class="message">Not registered? <a href="#">Create an account</a></p> </form> </div> </div> </body> </body> </html>
CSS Code
@import url(https://fonts.googleapis.com/css?family=Roboto:300); header .header{ background-color: #fff; height: 45px; } header a img{ width: 134px; margin-top: 4px; } .login-page { width: 360px; padding: 8% 0 0; margin: auto; } .login-page .form .login{ margin-top: -31px; margin-bottom: 26px; } .form { position: relative; z-index: 1; background: #FFFFFF; max-width: 360px; margin: 0 auto 100px; padding: 45px; text-align: center; box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24); } .form input { font-family: "Roboto", sans-serif; outline: 0; background: #f2f2f2; width: 100%; border: 0; margin: 0 0 15px; padding: 15px; box-sizing: border-box; font-size: 14px; } .form button { font-family: "Roboto", sans-serif; text-transform: uppercase; outline: 0; background-color: #328f8a; background-image: linear-gradient(45deg,#328f8a,#08ac4b); width: 100%; border: 0; padding: 15px; color: #FFFFFF; font-size: 14px; -webkit-transition: all 0.3 ease; transition: all 0.3 ease; cursor: pointer; } .form .message { margin: 15px 0 0; color: #b3b3b3; font-size: 12px; } .form .message a { color: #4CAF50; text-decoration: none; } .container { position: relative; z-index: 1; max-width: 300px; margin: 0 auto; } body { background-color: #328f8a; background-image: linear-gradient(45deg,#328f8a,#08ac4b); font-family: "Roboto", sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
First of all, we have imported our CSS file which consists of our CSS code that beautifies our HTML skeleton.
<title>
tag includes the page title which is displayed on top of browser. A form is created which includes all the elements of the form. Login action is triggered when user clicks the login button.
<form class="login-form"> <input type="text" placeholder="username"/> <input type="password" placeholder="password"/> <button>login</button> <p class="message">Not registered? <a href="#">Create an account</a></p> </form>
In CSS part,we have imported “Roboto” font using
@import
tag.
background-image: linear-gradient(45deg,#328f8a,#08ac4b);
is used to create the linear gradient seen in the backgorund.
This is a very simple login form created using css and html only.
Now lets design a complex form with more elements. Next design will consists of two part in a single page. One for login form and another for text and general information.
Two Section
Login Form
with HTML and CSS

Lets code the form and small content section.
Here, first we have imported CSS file and also fontawesome to use fonts for social icons. Then we have set the title of the page as ” Login Form Template Using HTML And CSS Only”. It is enclosed between
<title> </title>
tag. This content is visible on top of the page in browser.
<head> <link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <title>Login Form Using HTML And CSS Only</title> </head>
We have set the body of page to
container
. The container acts as the major block that holds other sub contents or elements. The main container is then divided into
form-container
and
overlay-container
.
<div class="container" id="container"> <div class="form-container log-in-container"> ............... ............... ............... </div> <div class="overlay-container"> <div class="overlay"> ............... ............... ............... </div> </div>
form-container
consists of a form and social icons on the top, which is to facilitate the login using social websites like Facebook or Twitter.
Below that is the form for user to enter the login credential ie, email and password. Here, form action is not set because we are working of web page design only. All the elements including social icons, placeholders for email and password and login button are inside the
<form> </form>
tag.
<form action="#"> <h1>Login</h1> <div class="social-container"> <a href="#" class="social"><i class="fa fa-facebook fa-2x"></i></a> <a href="#" class="social"><i class="fab fa fa-twitter fa-2x"></i></a> </div> <span>or use your account</span> <input type="email" placeholder="Email" /> <input type="password" placeholder="Password" /> <a href="#">Forgot your password?</a> <button>Log In</button> </form>
We have also put option for password reset in case user forgets it. When user clicks the login button, the login request is send using form action.
Another section
overlay-container
acts is the container that is in right side of login form.
<div class="overlay-container"> <div class="overlay"> <div class="overlay-panel overlay-right"> <h1>HTML CSS Login Form</h1> <p>This login form is created using pure HTML and CSS. For social icons, FontAwesome is used.</p> </div> </div> </div>
overlay-container
has overlay-panel overlay-right
which includes a short text inside
<h1>
tag and
<p>
tag.
Here is another CSS login form screen design template.
HTML Code
<!DOCTYPE html> <html> <head> <link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <title>Login Form Using HTML And CSS Only</title> </head> <body> <div class="container" id="container"> <div class="form-container log-in-container"> <form action="#"> <h1>Login</h1> <div class="social-container"> <a href="#" class="social"><i class="fa fa-facebook fa-2x"></i></a> <a href="#" class="social"><i class="fab fa fa-twitter fa-2x"></i></a> </div> <span>or use your account</span> <input type="email" placeholder="Email" /> <input type="password" placeholder="Password" /> <a href="#">Forgot your password?</a> <button>Log In</button> </form> </div> <div class="overlay-container"> <div class="overlay"> <div class="overlay-panel overlay-right"> <h1>HTML CSS Login Form</h1> <p>This login form is created using pure HTML and CSS. For social icons, FontAwesome is used.</p> </div> </div> </div> </div> </body> </html>
CSS Code
@import url('https://fonts.googleapis.com/css?family=Montserrat:400,800'); * { box-sizing: border-box; } body { background: #f3e0e2; display: flex; justify-content: center; align-items: center; flex-direction: column; font-family: 'Montserrat', sans-serif; height: 100vh; margin: -20px 0 50px; } h1 { font-weight: bold; margin: 0; } p { font-size: 14px; font-weight: 100; line-height: 20px; letter-spacing: 0.5px; margin: 20px 0 30px; } span { font-size: 12px; } a { color: #333; font-size: 14px; text-decoration: none; margin: 15px 0; } button { border-radius: 20px; border: 1px solid #FF4B2B; background-color: #FF4B2B; color: #FFFFFF; font-size: 12px; font-weight: bold; padding: 12px 45px; letter-spacing: 1px; text-transform: uppercase; transition: transform 80ms ease-in; } form { background-color: #FFFFFF; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 0 50px; height: 100%; text-align: center; } input { background-color: #eee; border: none; padding: 12px 15px; margin: 8px 0; width: 100%; } .container { background-color: #fff; border-radius: 10px; box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22); position: relative; overflow: hidden; width: 768px; max-width: 100%; min-height: 480px; } .form-container { position: absolute; top: 0; height: 100%; } .log-in-container { left: 0; width: 50%; z-index: 2; } .overlay-container { position: absolute; top: 0; left: 50%; width: 50%; height: 100%; } .overlay { background: #FF416C; background: -webkit-linear-gradient(to right, #FF4B2B, #FF416C); background: linear-gradient(to right, #FF4B2B, #FF416C); background-repeat: no-repeat; background-size: cover; background-position: 0 0; color: #FFFFFF; position: relative; left: -100%; height: 100%; width: 200%; } .overlay-panel { position: absolute; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 0 40px; text-align: center; top: 0; height: 100%; width: 50%; } .overlay-right { right: 0; } .social-container { margin: 50px 0; } .social-container a { border: 1px solid #DDDDDD; border-radius: 50%; display: inline-flex; justify-content: center; align-items: center; margin: 0 5px; height: 40px; width: 40px; }
Conclusion
You can easily create beautiful use interface for login using HTML and CSS. Using the pure concept of CSS and using color combination, login forms can be easily created. If you know the concepts of padding and margins, you can set the basic grounds for designs.
Thanks for reading our HTML CSS login tutorial.
Keep Learning.
Www Complinet Com Profile Login Html
Source: https://w3codepen.com/html-css-login-form-page/