Login form as become one of the outstanding ways of getting users information of feedback on a website . This has been done by using a form and login form to allow user to complete the feedback and submit the form.
Now the process of providing feedback to website is also becoming more effective and faster.
I think in the next couple of years we are going to see a big shift towards this. Users will start receiving feedback at all stages of their website life cycle from initial design to final production.
Another advantage of using forms is that they allow the user complete control of what information is sent to the website as well as the control to filter out information that he/she does not want to be sent.
Before jumping to the code though, let me show you what we will be creating:
How To Create a Login Form
Step 1) Add HTML:
As usual in HTML files, we have two parts: the <head> and the <body> . The former includes meta-information about our web page, like the character encoding used, the title of the page (the name you see in the tab of your browser) and references to the CSS and JavaScript files which this HTML file will make use of. Due note that there’s a defer attribute in the <script> tag so that the JavaScript script is only executed after the HTML is fully loaded.
In the <body>, we include all the information that will be visible in our page.
By the way, if you’re wondering why the <input> elements are not closed, it’s because they don’t need closing tags (</input> or something among those lines). It’s what we call self-closing tags.
Of course, we make plenty use of ids and classes to facilitate our work with CSS. The ids allow us to select HTML elements unambiguously, that is, each id represents a single element of our file. On the other hand, The class attribute is often used to point to a class name in a style sheet. It can also be used by a JavaScript to access and manipulate elements with the specific class name. We’ll see the practical use of these ids and classes next.
Step 2) Add CSS:
Now we have the CSS, in other words, the style of our page. To modify each element in our HTML file, we can select them using ids, classes or the tag names themselves, though the last option is discouraged. You see, the styles of more specific CSS selectors overwrite the styles of less specific ones. For example, the styles of an id selector overwrite those of a class selector, and class selector styles overwrite those of a tag name selector. In other words, always make your CSS selectors as specific as possible to affect only the elements you want to be affected.
And don’t forget, while tag name selectors just need the name of the tags, id selectors start with the pound sign (#) and class selectors start with a dot (.). If an element has an id “test-id”, then it can be selected in the CSS by its id using #test-id. If an element has a class “test-class”, then it can be identified as .test-class.
The animation is created by gradually changing from one set of CSS styles to another.
During the animation, you can change the set of CSS styles many times.
Specify when the style change will happen in percent, or with the keywords "from" and "to", which is the same as 0% and 100%. 0% is the beginning of the animation, 100% is when the animation is complete.
Tip: For best browser support, you should always define both the 0% and the 100% selectors.
Note: Use the animation properties to control the appearance of the animation, and also to bind the animation to selectors.
And after all this let see what we got.
Step 2) Add Javascript:
You can also view and test this code live at: Sololearn Code Playground
And… that’s it. We’ve reached the end of this explanation and now you have a fully functional login page created with HTML, CSS and JavaScript. I think this is a great idea for the early stages of learning front-end web development as it can be easily improved upon by adding animations, changing the design of the page or making the validation server-side when you learn a back-end language like Node.js, Java, PHP, etc.
I hope this article has been helpful for you and by all means let me know your feedback 💖💖



0 Comments