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

complete form design

Let us get started.

Code Structure

First, in our code editor, we are going to create a new folder. We can call the folder formInside 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:

HTML preview

HTML preview

Yes, that is ugly. Time for some CSS!

CSS

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

The Outcome:

first CSS preview

Furthermore, we need to style the labels and input. For the labelwe 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:

second css preview

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 borderradius. We also set the display to inline-block, this allows us to set padding to the side of the button.

Final Results:

final view

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.



Source link

Write A Comment