Sample of Register Form Using HTML and CSS
This is a sample of a simple registration form using HTML and CSS. To see the demo click here.
Table of Contents
{tocify} $title={Table of Contents}Complete HTML code:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Contact Us</title> </head> <body> <div class="container"> <form action="contactus.php"> <p> <h1>Register</h1> </p> <p> Please fill in this form to create an account. </p> <hr> <p> <label for="name">Name: </label> <input type="text" name="myName" id="name" placeholder="Enter Full Name" required> </p> <p> <label for="email">Email: </label> <input type="email" name="myEmail" id="email" placeholder="Enter Email" required> </p> <p> <label for="password">Password: </label> <input type="password" name="myPassword" id="password" required placeholder="Enter Password"> </p> <p> <label for="confirmPassword">Confirm Password: </label> <input type="password" name="confirmPassword" id="confirmPassword" required placeholder="Confirm Password"> </p> <hr> <p> By creating your account you aggree to our <a href="http://">Terms and Conditions</a> </p> <p> <button type="submit">Register</button> </p> <div class="containersignin"> <p> Already have an account? <a href="http://">Sign in</a> </p> </div> </form> </div> </body> </html>
Complete CSS Code:
*{ box-sizing: border-box; } body{ font-family: Verdana, Geneva, Tahoma, sans-serif; margin: 10px 10px; padding: 8px; font-size: 17px; background-color: rgb(218, 226, 228); } .container{ background-color: whitesmoke; margin: 15px 10px; padding: 20px; border-radius: 6px; border: 2px solid rgb(139, 197, 252); } input[type="text"], input[type="email"], input[type="password"] { width: 100%; padding: 10px; margin: 10px; margin: 7px; border: 1px solid rgb(221, 208, 208); border-radius: 5px; } label{ font-weight: bold; } hr{ border: rgb(188, 234, 248) solid 1px; margin-bottom: 25px; margin-top: 20px; } .containersignin{ background-color: rgb(188, 234, 248); text-align: center; padding: 1px; border-radius: 4px; } button{ width: 100%; border: none; padding: 16px 20px; margin: 8px 0; font-size: 18px; color: white; background-color: #04AA6D; border-radius: 4px; } button:hover{ background-color: rgb(19, 218, 198); cursor: pointer; }
Thanks!