Post Ticker

6/recent/ticker-posts

How to Make A Simple Login Form with HTML & CSS (Project-02)




At first, make a project folder. I named it Project-02. We need two files here one is index.html and another is stylesheet.css. like the picture: 


Copy the code which is blowing. and past it on index.html :

<!DOCTYPE htal>
<htmal>

    <head>
        <link rel="stylesheet" href="stylesheet.css">
        <title>A Simple Login Form</title>
        <style>
            body{
                background-imageurl(background.jpg);
                background-attachmentfixed;
                height100%;
                width100%;
            }
        </style>
    </head>

    <body>
        <div class="fromheader same-style">Login</div>
        <div class="formbody">
        <form>
            
            <!--E-Mail Fild-->
            <label class="mylable" for="e-mail">E-Mail Address</label><br>
            <input placeholder="Email Address (exampale@exampale.com)" type="text" name="e-mail" class="myfrom" required><br><br>
            <label class="mylable" for="password">Password</label><br>
            <input maxlength="12" minlength="5" placeholder="Password" type="password" name="password" class="myfrom" required><br>
            <p style="text-align: right; margin-right: 5%; color: gray;">Minemum Length: 5 and Maximum Length: 12</p>

            <br><input type="submit" name="submit" class="submit" value="Login">
        </form>
        </div>
        <div class="fromfooter same-style">Need to a membersheep? <a class="link" href="#">Sing Up</a></div>
    </body>
</htmal>

Now we can see a rendom form. 

Now we should add a CSS file which name is stylesheet.css. The CSS code is below:

body{background-coloraqua;}

div.fromheader{
    background-colorrgb(184250250);
    colorrgb(1059797);
    border-radius8px 8px 0px 0px;
    padding20px;
    text-aligncenter;
    margin-top20px;
    font-size30px;
    margin-left25%;
    margin-right25%;
}

div.fromfooter{
    background-colorrgb(184250250);
    colorrgb(1059797);
    border-radius0px 0px 8px 8px;
    padding20px;
    text-aligncenter;
    font-size15px;
    margin-bottom20px;
    margin-left25%;
    margin-right25%;
}

div.formbody{
    padding20px;
    background-colorazure;
    margin-left25%;
    margin-right25%;
}

input.myfrom{
    padding:12px;
    border1px solid gray;
    border-radius4px;
    margin-right8px;
    width95%;
}

label.mylablefont-size22px;}

input.submit{
    font-size22px;
    background-colorgreen;
    colorwhite;
    border-radius8px;
    padding10px;
    width95%;
    margin-right8px;
}

a.link{colorrgb(313030);}
a.link:hover{colorrgb(20204112);}

And add a line ih HTML to connect css into html file on the <head> tag.

<link rel="stylesheet" href="stylesheet.css">

After adding CSS and CSS link on HTML we can see a wonderful login form. 

Download Scour Code


Post a Comment

0 Comments