Create a simple login form in html
Before We Start
Simple login form in html. A login is the security of a system which is a set of credentials used to authenticate the users. Most often, these consist of some form of “username” and a matching “password”, and they are used to prevent unauthorized access to confidential data.
In a website the users can enter their own username and password and can check those by using validations which is correct or wrong and if it is wrong, users can identify which part has the problem, the username or the password.
In a website the login section is an important part and it helps the users to keep the trust on their account and data. So if you are a person who wishes to develop a website, you have to know how to create a login part properly. We are here to solve your problem.
However in this article you are going to learn, how to develop a full featured login page front end part of a website.
Before we start please read the below articles which easier you to understand the process, if you are new to development.
Step 1 – Add HTML
It’s too easy and simple. Just copy and paste below code in your HTML editor between <body> </body> tag.
<html>
<body>
<div id="login-card" class="card" style="background-color: #8ccaff;">
<div class="card-body">
<h2 class="text-center">Login form</h2>
<br>
<form action="/action_page.php">
<div class="form-group">
<input type="email" class="form-control" id="email" placeholder="Enter email" name="email">
</div>
<div class="form-group">
<input type="password" class="form-control" id="email" placeholder="Enter password" name="pswd">
</div>
<button type="submit" id="button" class="btn btn-primary deep-purple btn-block ">Submit</button>
<br>
<br>
<div id="btn" class="text-center">
<button type="button" class="btn btn-primary btn-circle btn-sm"><i class="fa fa-facebook"></i></button>
<button type="button" class="btn btn-danger btn-circle btn-sm"><i class="fa fa-google"></i></button>
<button type="button" class="btn btn-info btn-circle btn-sm"><i class="fa fa-twitter"></i></button>
</div>
</form>
</div>
<div>
</body>
</html>
Step 2 – Add CSS
We use some external CSS link to this code. No need to worry about this, copy and paste below code between <head></head> tag.
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font awesome/4.7.0/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css?family=Nunito:600,700,900" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
</head>
Copy and paste below code in your HTML editor between <style></style> tag.
<style>
#body {
font-family: 'Nunito';
background-color: #8ccaff;
}
#login-card{
width:350px;
border-radius: 25px;
margin:150px auto;
}
#email{
border-radius:30px;
background-color: #ebf0fc;
border-color: #ebf0fc;
color: #9da3b0;
}
#button{
border-radius:30px;
}
#btn{
position: absolute;
bottom: -35px;
padding: 5px;
margin: 0px 55px;
align-items: center;
border-radius: 5px"
}
#container{
margin-top:25px;
}
.btn-circle.btn-sm {
width: 40px;
height: 40px;
padding: 2px 0px;
border-radius: 25px;
font-size: 14px;
text-align: center;
margin: 8px;
}
</style>
Step 3 – Add JavaScript
We use some external JavaScript link to this code. No need to worry about this, copy and paste below code between <head></head> or any place in your code between <script></script> tag.
<script <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</script>
At the end we will have something like this. You can change fonts, colors, backgrounds and all things that you want. Enjoy it.
Video Tutorial
Please watch this video to better understand this tutorial and don’t forget to subscribe to our channel.
Help others to find out about this article on Social Media sites. If you have any doubt or any problem, don’t hesitate to contact us. Thereafter we will be able to help you and also make sure you bookmark our site on your browser.