Skip to main content

Login Form With Animated Placeholders Using Html & CSS

 Video:


Source Code:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login</title>
</head>
<style>
*{
    margin: 0;
    padding: 0;
    font-family: Century Gothic;
    box-sizing: border-box;
}

body{
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: -webkit-linear-gradient(right#7579ff#b224ef);
}

.parent h2{
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 40px;
    padding-bottom: 5px;
    width: 40%;
    border-bottom: 1px solid #ffffff;
}

.main_u{
    padding-bottom: 40px;
}

.user_div{
    height: 50px;
    width: 250px;
    position: relative;
    background: none;
}

.user_div label span{
    position: absolute;
    bottom: 3%;
    left: 0%;
    font-size: 20px;
    font-weight: 500;
    transition: 0.3s ease;
    color: #ffffff;
}

.user_div label input{
    height: 100%;
    width: 100%;
    padding-top: 20px;
    border: none;
    outline: none;
    border-bottom: 1px solid #ffffff;
    font-size: 18px;
    font-weight: 500;
    color: #ffffff;
    /* color: #00a3e8; */
    transition: .3s ease;
    background: none;
}

.user_div label input:focus ~ span,
.user_div label input:valid ~ span
{
    position: absolute;
    bottom: 100%;
    /* color: #00a3e8; */
    font-size: 15px;
}

/* .user_div label input:focus{
   border-bottom: 1px solid #00a3e8;
}
  */

.pass_div{
    height: 50px;
    width: 250px;
    position: relative;
    background: none;
}

.pass_div label span{
    position: absolute;
    bottom: 3%;
    left: 0%;
    font-size: 20px;
    font-weight: 500;
    transition: 0.3s ease;
    color: #ffffff;
}

.pass_div label input{
    height: 100%;
    width: 100%;
    padding-top: 20px;
    border: none;
    outline: none;
    border-bottom: 1px solid #ffffff;
    font-size: 18px;
    font-weight: 500;
    color: #ffffff;
    /* color: #00a3e8; */
    transition: .3s ease;
    background: none;
}

.pass_div label input:focus ~ span,
.pass_div label input:valid ~ span
{
    position: absolute;
    bottom: 100%;
    font-size: 15px;
    /* color: #00a3e8; */
}

/* .pass_div label input:focus{
    border-bottom: 1px solid #00a3e8;
} */

.btn{
    border: 1px solid #ffffff;
    background: none;
    outline: none;
    color: #ffffff;
    width: 50%;
    padding: 7px 10px;
    font-size: 20px;
    margin-top: 40px;
    transition: .3s ease;
    cursor: pointer;
}

.btn:hover{
    background: #ffffff;
    color: black;
}
</style>
<body>
    <div class="parent">
        <h2>Login</h2>
        <div class="main_u">
            <div class="user_div">
                <label for="user">
                    <input type="text" name="user" required>
                    <span>Username..</span>
                </label>
            </div>
        </div>
        <div class="main_p">
            <div class="pass_div">
                <label for="pass">
                    <input type="password" name="pass" required>
                    <span>Password..</span>
                </label>
            </div>
        </div>
        <button class="btn">Login</button>
    </div>
</body>
</html>

Comments

Popular posts from this blog

About us Page Using Html & Css Only

Video: Source Code : <! DOCTYPE   html > < html   lang = "en" > < head >      < meta   charset = "UTF-8" >      < meta   name = "viewport"   content = "width=device-width, initial-scale=1.0" >      < link   href = "https://fonts.googleapis.com/css2?family=Dancing+Script:wght@600&displa y=swap"   rel = "stylesheet" >      < link   rel = "stylesheet"   href = "style.css" >      < title > About Us Page </ title > </ head > < body >      < div   class = "container" >          < div   class = "text" >              < h1 > Code Incredible.. </ h1 >              < br >< br >              < p >                 Lorem ipsum dolor, sit amet consectetur adipisicing elit. Molestias  aliquid et numquam blanditiis vitae! Illum quidem magni numquam minima, velit suscipit , voluptatum accusantiu

Amazing 404 Error Page Using HTML & CSS

  Video: Source Code: <! DOCTYPE   html > < html   lang = "en" > < head >     < meta   charset = "UTF-8" >     < meta   name = "viewport"   content = "width=device-width, initial-scale=1.0" >     < meta   http-equiv = "X-UA-Compatible"   content = "ie=edge" >     < title >Error! 404</ title > </ head > <style> * {     margin:  0 ;     padding:  0 ;     font-family: Nunito;     box-sizing:  border-box ; } body {     background:  linear-gradient (to  right ,  #48dbfb ,  #1dd1a1 );     display:  flex ;     align-items:  center ;     justify-content:  center ;     min-height:  100 vh ; } .box {     width:  40 % ;     background:  #0abde3 ;     padding:  50 px ;     text-align:  center ;     color:  #ffffff ;     border-radius:  8 px ;      box-shadow:  0   19 px   38 px   rgba ( 0 ,  0 ,  0 ,  .3 ),  0   15 px   12 px   rgba ( 0 ,  0 ,  0 ,  .22 ); } .box   h1 {     margi

Parallax Website using HTML And CSS

VIDEO: Source Code:      Images used: HTML: <! DOCTYPE   html > < html   lang = "en" > < head >      < meta   charset = "UTF-8" >      < meta   name = "viewport"   content = "width=device-width, initial-scale=1.0" >      < link   rel = "stylesheet"   href = "style.css" >      < title > Parallax Website </ title > </ head > < body >      < div   class = "bg1" >          < h1 > Parallax </ h1 >      </ div >      < div   class = "bg2" >      </ div >      < div   class = "bg3" >      </ div >      </ body > </ html > CSS: * {      margin :  0 ;      padding :  0 ;      font-family : Century Gothic; } .bg1 {      height :  100 vh ;      width :  100 % ;      background :  url ( "photo1.jpg" )no-repeat;      background-size : cover;      background-attachment : fixed; } .bg