DEV Community

Cover image for Registration Form with HTML & CSS #1
deji adesoga
deji adesoga

Posted on • Updated on • Originally published at thecodeangle.com

Registration Form with HTML & CSS #1

What we know matters but who we are matters more.
-Brené Brown

Introduction

Today we are going to build a simple registration form. The requirements for this tutorial is just a basic knowledge of Html and CSS as well as a code editor.

A Preview of What We Are Going To Build:

Form Gif

Let us get started.

Code Structure

First, in our code editor, we are going to create a new folder. We can call the folder form. Inside that folder, we will create two files. The index.html and the style.css.

HTML

In the index.html file, we should have a bare bone structure similar to what is shown below:

Next, I am going to add the tags to the HTML page.

From the code above, we started by adding a form tag. In the form tag, there are four label tags and a button tag. Each input tag is wrapped in a label.

These labels are very important because they tell the user what information to provide in the form element.

This is all we need for the Html code and our form should look something like this:

Image

Yes, that is ugly. Time for some CSS!

CSS

We start in the style.css file by adding colour to the background of the page and also styling the form tag:

The Outcome:

Image

Furthermore, we need to style the labels and input. For the label, we will be adding letter-spacing, color, margin, padding and a positional direction for the label and the texts that will be within it.

The Outcome:

Image

Finally, we will be styling the line for the input field and the button.

To get the line effect, we need to set the height in the .line-box class. This will make the line visible. Also, we will be adding some transition effect when the input field is active.

The design for the button class is straight forward, We added a hover color, a background color, padding and border-radius. We also set the display to inline-block, this allows us to set padding to the side of the button.

Final Results:

Form Gif

Conclusion

I know this is a very basic tutorial, but I hope you can learn one or two things from it.

Here is the link to the repo on Github.

Support me by subscribing to my newsletter here.

Top comments (0)