adc

clicks

How To Create Login Form In HTML and CSS || Login Form In HTML and CSS

 Follow the steps to create a responsive Login form using CSS. Add an image inside a container and add inputs with matching labels for each field. Wrap a “form” element around them to process the input. Add the required CSS to design the login page try to keep the design as simple as possible.

 HTML

Before we start writing code first, we need to create a primary structure of the HTML document, so that the browser can understand and start working. The basic HTML structure looks like the following.

After writing the primary structure of the HTML document, you will also write the tags and content you need. After that, you can see the output in your browser. We know that HTML Sudu Mae is used for exposing content in a basic format. To complete our content we need to use CSS, which is an HTML insert and it creates an engaging user interface.

 <!DOCTYPE html>
<html>
<head>
    <title></title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="style.css">

</head>
<body>
    <div class="login-box">
        <h1>Login</h1>
        <div class="textbox">
            <i class="fa fa-user-circle-o"></i>
            <input type="text" name="" placeholder="Username">
        </div>
        <div class="textbox">
            <i class="fa fa-lock"></i>
            <input type="password" name="" placeholder="password">
        </div>
        <input type="button" name="" class="btn" value="Sign in">
    </div>

</body>
</html
>

CSS

Now, we have time to improve the HTML content, for that, we need to add CSS to the HTML file. CSS can be added to HTML documents in a total of three ways, here we are using outside CSS design using CSS will arrive here after typing and see the output in your browser.

 @import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@700&display=swap');


body{
    font-family: 'Merriweather', serif;
    margin: 0;
    padding: 0;
    background:url(bg.jpg) no-repeat;
    background-size: cover;
}
.login-box{
    width: 280px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #f9c700;
}
.login-box h1{
    font:left;
    font-size: 40px;
    border-bottom: 6px solid #800000;
    margin-bottom: 50px;
    padding: 13px 0;
}

.textbox{
    width: 100%;
    overflow: hidden;
    font-size: 20px;
    padding: 8px 0;
    margin: 8px 0;
    border-bottom: 2px solid #800000;
}

.textbox i{
    width: 26px;
    float: left;
    text-align: center;

}
.textbox input{
    border: none;
    outline: none;
    background:none;
    color: white;
    font-size: 18px;
    width: 80%;
    float: left;
    margin: 0 10px;
}

.btn{
    width: 100%;
    background:none;
    border:2.5px solid #800000;
    color: white;
    padding: 5px;
    font-size: 18px;
    cursor: pointer;
    margin: 12px 0;
}

 Image Link  

source code

 

                           Watch Video 

 

 More Tutorials

How To Create Login Form In HTML and CSS || Login Form In HTML and CSS How To Create Login Form In HTML and CSS || Login Form In HTML and CSS Reviewed by easycoding on August 17, 2020 Rating: 5

No comments:

Powered by Blogger.