| Viewed 71 times

how to create registration form in html


how to create registration form in html

1 Answer
Mikdam Qandeel
Answered
7

The registration form is an essential part of any dynamic websites.

you have to start with the <form> tag, Then add some inputs with <input> tag and label them with <label> tag. so let the user enter his name, e-mail and the message he wants to send. and a small button to clear the form to make it more useability.

Example:

<form action="" method="GET">

	<label for="name">Your Name</label>
    <input type="text" name="name">
    
    <label for="gender">Your Gender</label>
    <input type="radio" name="gender" value="male">Male
    <input type="radio" name="gender" value="female">Female
  <br>
    <label for="email">Email</label>
    <input type="text" name="email">

    <label for="password">Password</label>
    <input type="password" name="password">

    <label for="co-password">Confirm your Password</label>
    <input type="password" name="co-password">

    <button type="submit" class="registerbtn">Register</button>

</form>

 

Ok, that's nice but still, need some touches with CSS, change the margin, padding and some colors.

Example:

form {
	width: 500px;
    height: 400px;
    background-color: #ccc;
    text-align: center;
    padding:30px;
}

input[type=text], input[type=password] {
  width: 400px;
  padding: 10px;
  margin: 15px 40px;
  display: block;
  border: none;
  background: #f1f1f1;
}


.registerbtn {
  background-color: yellow;
  padding: 16px 20px;
  margin: 5px 0 22px 0;
  border: none;
  width: 50%;
  opacity: 0.8;
}

.registerbtn:hover {
  opacity: 1;
}

Output:

how to create registration form in html