banner



How To Create A Login Box In Html

  • Updated date Mar 18, 2020
  • 489.9k
  • 7

In this article, you will learn how to create a simple login page using HTML and CSS.

Introduction

HTML stands for HyperText Markup Language. This is the most important markup language that can be used to create a webpage. It is used to display text, image, audio, and video in a webpage.

CSS stands for Cascading Style Sheets. It is used to style HTML documents. CSS can make responsive web pages and is used for styling and its collection of formatting rules. It is used for designing purposes. The CSS extension is (.CSS).

There are three types of CSS:

  • Inline CSS

  • Internal CSS

  • External CSS

Step 1

Create a new folder and give a name to the folder. In the folder save an HTML and CSS file. After creating the folders, open the sublime text editor.

How To Create A Simple Login Page Using HTML And CSS

Step 2

Click File, Select New File, and Click Save. Give the file the name "index.html".

How To Create A Simple Login Page Using HTML And CSS

Step 3

Next, click File, then New File, and click Save. Give the file the name "style.css"

How To Create A Simple Login Page Using HTML And CSS

Step 4

Now, link the HTML and CSS to the HTML file you just copied and paste this code in the heading tag:

  1.  <head>
  2.    <link rel="stylesheet"  type= "text/css"  href= "css/style.css" />
  3. </head>

Step 5

Next, create a structure for the login page using HTML, Username and Password.

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title>Login Form</title>
  5.     <link rel="stylesheet"  type= "text/css"  href= "css/style.css" >
  6. </head>
  7. <body>
  8.     <h2>Login Page</h2><br>
  9.     <divclass = "login" >
  10.     <form id="login"  method= "get"  action= "login.php" >
  11.         <label><b>User Name
  12.         </b>
  13.         </label>
  14.         <input type="text"  name= "Uname"  id= "Uname"  placeholder= "Username" >
  15.         <br><br>
  16.         <label><b>Password
  17.         </b>
  18.         </label>
  19.         <input type="Password"  name= "Pass"  id= "Pass"  placeholder= "Password" >
  20.         <br><br>
  21.         <input type="button"  name= "log"  id= "log"  value= "Log In Here" >
  22.         <br><br>
  23.         <input type="checkbox"  id= "check" >
  24.         <span>Remember me</span>
  25.         <br><br>
  26.         Forgot <a href="#" >Password</a>
  27.     </form>
  28. </div>
  29. </body>
  30. </html>

Step 6

Next, write code in CSS to apply some style to the HTML so you can change the look of the login page.

  1. body
  2. {
  3. margin : 0 ;
  4. padding : 0 ;
  5. background-color : #6abade ba;
  6. font-family : 'Arial' ;
  7. }
  8. .login{
  9. width : 382px ;
  10. overflow : hidden ;
  11. margin : auto ;
  12. margin : 20 0 0 450px ;
  13. padding : 80px ;
  14. background : #23463f ;
  15.         border-radius:15px  ;
  16. }
  17. h2 {
  18. text-align : center ;
  19. color : #277582 ;
  20. padding : 20px ;
  21. }
  22. label{
  23. color : #08ffd1 ;
  24. font-size : 17px ;
  25. }
  26. #Uname {
  27. width : 300px ;
  28. height : 30px ;
  29. border : none ;
  30.     border-radius:3px ;
  31. padding-left : 8px ;
  32. }
  33. #Pass {
  34. width : 300px ;
  35. height : 30px ;
  36. border : none ;
  37.     border-radius:3px ;
  38. padding-left : 8px ;
  39. }
  40. #log {
  41. width : 300px ;
  42. height : 30px ;
  43. border : none ;
  44.     border-radius:17px ;
  45. padding-left : 7px ;
  46. color : blue ;
  47. }
  48. span{
  49. color : white ;
  50. font-size : 17px ;
  51. }
  52. a{
  53. float : right ;
  54. background-color : grey;
  55. }

Step 7

Before using CSS code, the output looked like this:

How To Create A Simple Login Page Using HTML And CSS

After using the CSS code, the output looks like this:

How To Create A Simple Login Page Using HTML And CSS

Summary

We have successfully created a Login page. I hope this article is useful to you. If you have any comments in this article, please ask in the comment section.

How To Create A Login Box In Html

Source: https://www.c-sharpcorner.com/article/creating-a-simple-login-page-using-html-and-css/

Posted by: francisviode1952.blogspot.com

0 Response to "How To Create A Login Box In Html"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel