HTML FORMS /
Login Form
/
Login Form - Simple
<!DOCTYPE html> <html> <head> <title>Login form</title> <style> html, body { display: flex; justify-content: center; font-family: lato, sans-serif; font-size: 14px; } form { border: 10px solid #ccc; } input[type=text], input[type=password] { width: 100%; padding: 16px 8px; margin: 8px 0; display: inline-block; border: 1px solid #ccc; box-sizing: border-box; } button { background-color: black; color: white; padding: 14px 0; margin: 10px 0; border: none; cursor: grabbing; width: 100%; } h1 { text-align:center; font-size:18; } button:hover { opacity: 0.8; } .formcontainer { text-align: left; margin: 24px 50px 12px; } .container { padding: 16px 0; text-align:left; } span.psw { float: right; padding-top: 0; padding-right: 15px; } @media screen and (max-width: 300px) { span.psw { display: block; float: none; } </style> </head> <body> <form action="/action_page.php"> <h1>Login Form</h1> <div class="formcontainer"> <hr/> <div class="container"> <label for="uname"><strong>Username</strong></label> <input type="text" placeholder="Enter Username" name="uname" required> <label for="psw"><strong>Password</strong></label> <input type="password" placeholder="Enter Password" name="psw" required> </div> <button type="submit">Login</button> <div class="container" style="background-color: #eee"> <label style="padding-left: 15px"> <input type="checkbox" checked="checked" name="remember"> Remember me </label> <span class="psw"><a href="#"> Forgot password?</a></span> </div>