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

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-heigh...

Pure CSS Hamburger Menu | Side Bar Menu

Video:  Source Code: HTML <! 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" >      < link   rel = "stylesheet"   href = "style.css" >      < title > Hamburger Menu </ title > </ head > < body >      < input   type = "checkbox"   name = ""   id = "check" >      < label   class = "ham_menu"   for = "check" > &#9776; </ label >      < div   class = "main" >          < label   for = "check" > &times; </ label ...

UI Card Design Using Only HTML and CSS

\ <! 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 >UI CARD DESIGN</ title >     < link   rel = "stylesheet"   href = "style.css" > </ head > < body >     < div   class = "box" >         < div   class = "text" >             < h2 >Gaming Mouse</ h2 >             < p >Lorem ipsum dolor sit amet consectetur adipisicing...