Creating a Registration form in HTML using CSS.

Registration form using HTML and CSS

In this tutorial of HTML/CSS we will create a Basic Registartion form and will give some design to it using CSS.

Before starting this tutorial I'm assuming that you already have some basic knowledge of HTML tags and CSS properties.

If you want to see Registration form look / design you can click here.

So, Let us proceed to our HTML code first.


HTML CODE

<html>

<head>
    <title> REGISTRATION FORM </title>
    <link rel="stylesheet" href="Registration Form.css">
</head>

<body>
    <div class="Registration">
        <h2> REGISTER HERE..</h2>
        <div class="container">
            <form>
                <img class="avatar" src="I80W1Q0.png"  
alt="avatar image">
                <br>
                <br>
                <label style="text-align: left;">Full Name: 
</label><br>
                <input type="text" name="user name" 
                    placeholder="Name.." required>
                <br>
                <label>Email:</label> <br>
                <input type="text" name="email address"  
            placeholder="Email Address.." required>
                <br>
                <label>Date of Birth:</label><br>
                <input type="date" name="DOB" required><br>
                <br>

                <label>Country: </label> <br>
                <select name="country">
                   <option value="select" disabled selected>
                 --Select Country--</option>
                    <option value="India">INDIA</option>
                    <option value="USA">USA</option>
                    <option value="Canada">CANDA</option>
                    <option value="UK">UK</option>
                    <option value="ENGLAND">ENGLAND</option>
                </select>
                <br>
                <label>Phone Number:</label><br>
                <input type="tel" name="Phone Number" 
             placeholder="Enter Phone Number..">
                <br>
                <label>Password: </label> <br>
                <input type="password" name="user password" 
                 placeholder="Password" required>
                <br>
                <label>Confirm Password: </label> <br>
         <input type="password" name="confirm user password" 
             placeholder="Confirm Password" required>
                <br>
                <input type="checkbox" required> I agree to 
                Terms & Conditions<br>
                <input type="Submit" value="REGISTER">
        </div>
        </form>
    </div>
</body>
</html>

Now, basic struture of our Registration form is ready..


Let us apply some CSS Properties to give it some fancy style.

ADVERTISEMENT


CSS Code:

* {
  padding0px;
  text-aligncenter;
}
.container {
  padding16px;
}
h2 {
  margin-top4px;
  font-family: -apple-ystem, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans""Helvetica Neue"sans-serif;
  text-aligncenter;
}
.avatar {
  width100px;
  height100px;
  vertical-alignmiddle;
}
.Registration {
  marginauto;
  width550px;
  margin-top30px;
  margin-bottom30px;
  box-sizingborder-box;
  border1px solid rgba(000.1);
  box-shadow0 5px 10px rgba(000.2);
}
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="password"],
input[type="date"],
select {
  width400px;
  bordernone;
  padding12px 20px;
  text-alignleft;
  margin5px 0px;
  displayinline-block;
  border1px solid blue;
  border-radius5px;
}
input[type="Submit"] {
  width300px;
  padding14px 20px;
  background-color#4caf50;
  bordernone;
  cursorpointer;
  margin-top20px;
  color#000;
  font-weightbold;
  font-variantsmall-caps;
  border-radius1em;
}
input[type="Submit"]:hover {
  opacity0.8;
}

div label {
  font-weightbolder;
  padding3px;
  margin0px;
  text-alignleft;
}
select:focus,
input[type="tel"]:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus {
  border2px solid blue;
}
input[type="radio"] {
  margin-left10px;
  displayinline-table;
}



So, now our HTML code and CSS styling code has been Completed. Let us see what we have made..

Result:

To download Source code. Click here..

Registration form Source Code (Github): Click here

Live Example below:

Credits: Codepen

See the Pen Registration Form HTML, CSS. by Abhishek Raj (@_abhishek_raj_) on CodePen.

If you like this tutorial share it with your friends. Keep Learning..
Previous Post Next Post

Contact Form