Create a Responsive Login Form in HTML and CSS in Hindi
![]() |
Login Form in HTML and CSS |
As you can see I try to make a Login form that should be different from others available online on any social media. Believe me, you gonna learn many new technique and tips on how to make a Responsive Login Form in HTML and CSS in Hindi.
Let's talk about the background of the Login form in Hindi first. You can see It's a diagonal background and I know must of are thinking how we can create a diagonal webpage. Believe me, I wrote only one line of code to get the diagonal background on my Login Form in Hindi.
background-image: linear-gradient(to top right, #color1 50%, #color2 50%);
Create a Responsive Login Form in HTML and CSS in Hindi
Now we will come to our Center Div. If you noticed I used the same code to give the background color as we did on the main background. I only interchanged the color name and we have an awesome background center div. Also, on how to make a div perfectly center both horizontally and vertically is by using the position and translate property of CSS.
I know most of the programmer at first face problem on how to make the image half center on top and then perfectly center of the total width. Again here we will use the position concept of CSS and also we will use calc() property of CSS and it is the best in making anything responsive.
So what is calc()?
It takes the expression or maths calculation to solve and try to make perfect?
Create a Responsive Login Form in HTML and CSS in Hindi
Finally, we have beautiful centered Input fields and Buttons. Here also I show you how to make the input field centered and responsive.Point to remember is that Input field is by default Inline, So we need to specify display: block.
I know must of you are here for source code only. Here is the source code.Index.html file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>LoginForm</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Cinzel" rel="stylesheet">
</head>
<body>
<div class="bgimg">
<div class="centerdiv">
<img src="https://cdn1.iconfinder.com/data/icons/flat-business-icons/128/user-128.png" id="profilepic">
<h2>user login</h2>
<form>
<div>
<input type="text" name="" class="inputbox" placeholder="Username">
</div>
<br>
<div>
<input type="Password" name="" class="inputbox" placeholder="Password">
</div>
<br>
<div>
<button type="submit"> LOGIN </button>
</div>
</form> <br>
<div class="FORGOT-SECTION">
<h4>Forget Password?</h4>
</div>
</div>
</div>
</body>
</html>
style.css File Code
*{
margin: 0;
padding: 0;
font-family: 'Cinzel', serif;
}
.bgimg{
width: 100%;
height: 100vh;
background-image: linear-gradient(27deg, #004E95 50%, #013A6B 50%);
}
.centerdiv{
width: 350px;
height: 400px;
position: absolute;
top: 50%;
left: 50%;
background-color: red;
transform: translate(-50%, -50%);
background-image: linear-gradient(27deg, #013A6B 50%, #004E95 50%);
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.24);
}
#profilepic{
width: 120px;
height: 120px;
border-radius: 50%;
position: relative;
top: -60px;
left: calc( (350px - 120px) / 2 )
}
h2{
text-align: center;
color: white;
text-transform: uppercase;
font-size: 2em;
word-spacing: 10px;
margin-top: -50px;
margin-bottom: 50px;
text-shadow: -2px 2px 1px #0A84C6;
}
.inputbox{
width: calc(100% - 40px);
height: 30px;
display: block;
margin: auto;
padding: 0 10px;
box-sizing: border-box;
}
::placeholder{
letter-spacing: 2px;
color: black;
}
button{
width: calc(100% - 40px);
height: 30px;
display: block;
margin: auto;
color: white;
background-color: #0A84C6;
border: none;
}
.FORGOT-SECTION{
width: calc(100% - 40px);
line-height: 30px;
display: block;
margin: auto;
color: white;
background-color: dodgerblue;
text-transform: uppercase;
font-size: 0.8em;
text-align: right;
padding-right: 20px;
box-sizing: border-box;
}
margin: 0;
padding: 0;
font-family: 'Cinzel', serif;
}
.bgimg{
width: 100%;
height: 100vh;
background-image: linear-gradient(27deg, #004E95 50%, #013A6B 50%);
}
.centerdiv{
width: 350px;
height: 400px;
position: absolute;
top: 50%;
left: 50%;
background-color: red;
transform: translate(-50%, -50%);
background-image: linear-gradient(27deg, #013A6B 50%, #004E95 50%);
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.24);
}
#profilepic{
width: 120px;
height: 120px;
border-radius: 50%;
position: relative;
top: -60px;
left: calc( (350px - 120px) / 2 )
}
h2{
text-align: center;
color: white;
text-transform: uppercase;
font-size: 2em;
word-spacing: 10px;
margin-top: -50px;
margin-bottom: 50px;
text-shadow: -2px 2px 1px #0A84C6;
}
.inputbox{
width: calc(100% - 40px);
height: 30px;
display: block;
margin: auto;
padding: 0 10px;
box-sizing: border-box;
}
::placeholder{
letter-spacing: 2px;
color: black;
}
button{
width: calc(100% - 40px);
height: 30px;
display: block;
margin: auto;
color: white;
background-color: #0A84C6;
border: none;
}
.FORGOT-SECTION{
width: calc(100% - 40px);
line-height: 30px;
display: block;
margin: auto;
color: white;
background-color: dodgerblue;
text-transform: uppercase;
font-size: 0.8em;
text-align: right;
padding-right: 20px;
box-sizing: border-box;
}
Heada off you realy desreved it sir please make complete package of php i want leran more from you your teaching is best and it gives me more confidence
ReplyDeleteI also want to learn a complete PHP project with you...
ReplyDeleteit helps us alot sir thanks a lot...
ReplyDeletei like your way to explain and teaching style
ReplyDeletealso like when you say in all your video (BOOOOOOMMMM GUYS.....)
Thank U Thappa Love From Pakistan
ReplyDelete
ReplyDeletegreat sir...!
this is uzair khan & i am from pkistan.
Sir i made it but did not reasposive can you help me sir? i need your help thank you...!
Email: uk66199@gmail.com
Contact no: 00923118224351
nice sir
ReplyDeleteI think that thanks for the valuabe information and insights you have so provided here. Hotmail Login
ReplyDeleteHe forgot to make the username and password required if it's not required then the user can just press login and get account without doing anything. Also he forgot the register.
ReplyDeleteI love this Login Form! Thank for your guide.
ReplyDeleteProWeb365 Minneapolis Web Design
Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. entrar hotmail
ReplyDeleteNowadays, web development, digital marketing these are the main option to bring our online business and website into the highest position. Also if you don't have any idea about this that where you can find the best agency then you may look out https://capitaldealersolutions.com/ to get the best digital marketing services.
ReplyDeleteI read this article. I think You put a lot of effort to create this article. I appreciate your work. Hindi tips
ReplyDeleteWhatsApp bulk message sender empowers ventures to send messages to clients in bulk with a single tap. Sending boundless messages, utilizing multi-media messages, planning the campaigns, evacuating copy messages, sifting numbers, etc. Line blasting
ReplyDeleteThat's awesome yo can get best quality red leather jacket.
ReplyDelete