Create a Modern Login and Registration Page with HTML & CSS (Step-by-Step Guide)

Introduction:

Creating a login and registration page in HTML and CSS is one of the best ways to kick-off your front-end development endeavor. Whether you’re learning about web design, or creating your first front-end project, this simple set of steps will help you create a responsive login form and signup page that is polished and professional, no JavaScript required.

The Importance of Login and Registration Pages

Every site or web app needs a login and registration form system to handle user access and ultimately visitors on the system. From eCommerce sites to social media apps, login and registration forms are necessary for user authentication and for pleasant user experience.

With a solid HTML and CSS framework, you can design a simple but modern user interface (UI) that improves the usability of a website and reinforces their brand.

Step-by-Step Tutorial

Step 1: Setting Up the HTML Structure for Login Page

Begin with building the basic HTML structure for our login page. 

🌐
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <title>Login Page with Registration Modal</title>
  <link rel="stylesheet" href="logreg.css">
</head>
<body>
  <div class="form-container">
    <form action="home.html">
      <h1>Login</h1>
      <label for="Username">Username or Email:</label>
      <input type="text" id="Username" name="Username" 
             placeholder="Enter username or email" required>

      <label for="password">Password:</label>
      <input type="password" id="password" name="password" 
             placeholder="Enter password" required>

      <button type="submit">Login</button>

      <p>Don't have an account?
        <a onclick="document.getElementById('modal').classList.add('active')">
          Register
        </a>
      </p>
    </form>
  </div>
</body>
</html>

What Does It All Mean? 

  • HTML Structure and DOCTYPE: First, we declare the HTML5 doctype. Then, we set up the basic HTML structure with useful meta tags for character encoding and responsive viewport.
  • Form Tag: The  tag wraps our login inputs. Within the <form> tag, action=”home.html” tells the browser to take me to the home page when our form submits.
  • Input Fields: We are using type=”text” for our username field input, and then type=”password” for our password field input (which automatically hides the characters entered).
  • Required Attribute: Adding required to our inputs means the user cannot submit an empty application form. The browser automatically validates this!
  • Register Link: Remember the onclick attribute that we added? We added that to have a JavaScript event that shows the register modal when the link is clicked.

Tip: Use semantic HTML as much as possible with proper label and input types. This offers accessibility and helps screen readers understand your form.

Step 2: Creating the Registration Modal 

Now we will add the modal popup which contains our registration form.

🌐
<div class="modal" id="modal">
  <div class="form-container2">
    <div class="close-modal">
      <a onclick="document.getElementById('modal').classList.remove('active')">
        ×
      </a>
    </div>
    <form>
      <h1>Registration</h1>
      <div class="row">
        <!-- Form fields will go here -->
      </div>
    </form>
  </div>
</div>

Modal Outline:

  • Modal Wrapper: The outer <div class=”modal”> creates a full page overlay that covers the login page.
  • Close Button: The &times; HTML entity is translated as an “×” symbol. It has a click event which removes the “active” class and hides the modal.
  • Form Container: The inner container holds our registration form. It is centered over the dark overlay.

Note: The modal is hidden by default (i.e. through CSS) and only appears when the “active class” is added through JavaScript.

Step 3: Adding Registration Form Fields

We will now add fields to the registration form with different input types.

🌐
<div class="row">
  <div class="half">
    <label>👩🏻‍💼 First Name:</label>
    <input type="text" placeholder="Your First Name" required>
  </div>
  
  <div class="half">
    <label>👩🏻‍💼 Last Name:</label>
    <input type="text" placeholder="Your Last Name" required>
  </div>
  
  <div class="half">
    <label>📧 Email:</label>
    <input type="email" placeholder="Enter Email ID" required>
  </div>
  
  <div class="half">
    <label>🔒 Password:</label>
    <input type="password" placeholder="Enter Password" required>
  </div>
  
  <div class="half">
    <label>✅ Confirm Password:</label>
    <input type="password" placeholder="Confirm Password" required>
  </div>
</div>

Key Concepts:

  • Grid Layout: The row class uses CSS Grid in order to create a responsive multi-column layout. Each .half div is a mark-up representation of one field.
  • Email Input Type: The type=”email” input type has built-in validation, and the browser will check that the input is in valid email format.
  • Emojis in Labels: Using emojis can help make the form look more visually appealing and help the user quickly identify field types.

     

Pro Tip: Make sure to always include a Confirm Password field so users don’t accidentally add a typo when registering.

Step 4: Adding Gender Selection with Radio Buttons

🌐
<div class="half">
  <label class="gender-label">⚧️ Gender:</label>
  <div class="gender-group">
    <label><input type="radio" name="gender" value="male" required> Male</label>
    <label><input type="radio" name="gender" value="female" required> Female</label>
    <label><input type="radio" name="gender" value="other" required> Other</label>
  </div>
</div>

How Radio Buttons Work:

  • Name Attribute: All radio buttons will share the same name=”gender” to enforce a single selection. 
  • Value Attribute: Each radio button has a value, which will be sent with the form. 
  • Grouping: The .gender-group class will style the radio buttons in a row using Flexbox. 

Common Mistake: If you do not give related radio buttons the same name, you will be able to select multiple options, which is not intended!

Step 5: Adding Dropdown Selections

🌐
<div class="half">
  <label>🌍 Countries:</label>
  <select required>
    <option disabled selected>Select Country</option>
    <option value="india">India</option>
    <option value="brazil">Brazil</option>
    <option value="australia">Australia</option>
    <option value="china">China</option>
    <option value="france">France</option>
  </select>
</div>

<div class="half">
  <label>🏛️ State:</label>
  <select required>
    <option disabled selected>Select State</option>
    <option value="gujarat">Gujarat</option>
    <option value="kerala">Kerala</option>
    <option value="punjab">Punjab</option>
  </select>
</div>

Understanding Select Elements:

  • Disabled + Selected: This method utilizes the first option as a placeholder and can no longer be selected once an option is selected.
  • Required Attribute: This forces users to select a value before submitting.
  • Value Attribute: This is the value sent to the server, and many databases will use a simple lowercase value for the database.

Note: In a real application, you would use JavaScript/jQuery functionality to populate the state/city options based on the selected country.

Step 6: Adding Advanced Input Types

You will find countless specialized input types that HTML5 uses to make forms more user-friendly: 

🌐
<div class="half">
  <label>🔢 Age:</label>
  <input type="number" placeholder="Your Age" required>
</div>

<div class="half">
  <label>📞 Phone:</label>
  <input type="tel" placeholder="Phone Number" required>
</div>

<div class="half">
  <label>🎂 Date of Birth:</label>
  <input type="date" required>
</div>

<div class="half">
  <label>🕰️ Contact Time:</label>
  <input type="time">
</div>

<div class="half">
  <label>📝 Resume:</label>
  <input type="file">
</div>

<div class="half">
  <label>😊 Satisfaction (1–10):</label>
  <input type="range" min="1" max="10">
</div>

Input type descriptions:

  • type=”number”: Up/down arrows and restricting input to numbers
  • type=”tel”: Specially formatted for use with phone numbers (and on mobile it shows a numeric keypad)
  • type=”date”: Calendar picker
  • type=”time”: Time picker with hours and minutes
  • type=”file”: Lets the user upload a file from their computer/device
  • type=”range”: Slider control intended to select a value from a range

Pro Tip: HTML5 Input types provide a better experience on mobile because they automatically show the proper keyboards! 

Step 7: Adding Terms & Conditions and Submit Button

🌐
<div class="checkbox-container">
  <input type="checkbox" required>
  <label>I agree to the terms & conditions</label>
</div>

<input type="hidden" value="student">

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

<p>Already have an account? 
  <a onclick="document.getElementById('modal').classList.remove('active')">
    Login
  </a>
</p>

Final Form Elements:

  • Checkbox: Requires the use of the required attribute to force the user to agree to the terms of service before submitting the form. 
  • Hidden Input: type=”hidden” fields hold data that is not displayed to users but submitted with the form (for example, they can track user ID).
  • Submit Button: Executes form validation and submission when selected.  

Step 8: Styling the Login Page (CSS)

Now let’s beautify our login page with CSS:    

🌐
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: blue;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.form-container {
  background: white;
  padding: 40px 30px;
  border-radius: 8px;
  box-shadow: 0 6px 13px rgba(0, 0, 0, 0.3);
  width: 350px;
}

CSS Basics:   

  • CSS Reset: * { margin: 0; padding: 0; } removes the default spacing added by your browser so styling will be uniform.   
  • Box-sizing: border-box allows the padding and border to be included in the total width/height of its element.    
  • Flexbox Centering: display: flex along with justify-content and align-items makes centering easy both vertically and horizontally.    
  • Box Shadow: Adds depth—making the form “pop” out of the page.   

Step 9: Styling Form Elements

🌐
h1 {
  text-align: center;
  margin-bottom: 20px;
}

label {
  display: block;
  margin-top: 15px;
  font-weight: 500;
}

input, select, textarea {
  width: 100%;
  padding: 8px;
  margin-top: 5px;
  border-radius: 6px;
  border: 1px solid black;
  background-color: #fff6f6;
  transition: 0.3s;
}

input:focus, select:focus, textarea:focus {
  background-color: #eef7ff;
  outline: none;
}

Styling Principles:  

  • Block Display: display: block on labels makes it so they show up above the inputs.    
  • 100% Width: Makes inputs fill their container for a clean look.   
  • Focus States: Using the :focus pseudo-class to change the background color of when someone clicks into a field gives the user feedback.    
  • Transitions: Smooth 0.3s transitions give, for a polished, professional effect.   

Note: You can remove the default outline on focus IF you are providing a visual for the user’s focus (like we are doing with the background color change).   

Step 10: Creating the Modal Overlay

🌐
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center;
  align-items: start;
  overflow-y: scroll;
  padding: 40px 10px;
  z-index: 1000;
}

.modal.active {
  display: flex;
}

Modal CSS Explained:   

  • Fixed Positioning: the modal will stay in the same place as you scroll.   
  • Full Viewport: 100vw and 100vh make it full screen.    
  • RGBA background: rgba(0, 0, 0, 0.9) (0.9 = 90% opacity) makes it semi-transparent black screen.   
  • Display None: This makes it “display: none;” by default, to be hidden. 
  • Active Class: Initially, JavaScript adds “active” to indicate that we want it to show and display: flex; makes it visible.
  • Z-index:  Moreover, it will help maintain the modal above all other content.

Step 11: Styling the Registration Form Grid

🌐
.form-container2 {
  background: white;
  padding: 40px 30px;
  border-radius: 8px;
  box-shadow: 0 6px 13px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 900px;
  margin: auto;
}

.row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.row .half {
  width: 100%;
}

CSS Grid Layout:

  • Grid Template Columns: repeat(3, 1fr) – creates three columns of equal width.
  • 1fr Unit: A unit of 1 fraction of available space, therefore three columns means each column would get 1/3 of the space.
  • Gap: Adds space between grid items (much cleaner to use grid instead of margins on individual items).

Pro Tip: Using css grid is best for form layouts since it takes care of spacing and alignment automatically!

Step 12: Making It Responsive

🌐
@media (max-width: 900px) {
  .row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .row {
    grid-template-columns: 1fr;
  }
}

Responsive Design Principles:

  • Media Queries: Different properties by screen width.
  • Breakpoints: At 900px we are switching from 3 columns to 2. At 600 px we will use a single column (for mobile). 
  • Mobile-First Approach: Assuming forms are usable on all devices. 

Common Mistake: Forgetting to test on mobile! Always review your forms with different screen sizes.

Step 13: Creating the Welcome/Logout Page

After successful login, user will be redirected to this welcome page:

🌐
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Welcome To Home Page</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" 
          rel="stylesheet" />
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css" 
          rel="stylesheet" />
    <link rel="stylesheet" href="home.css">
</head>
<body>
    <div class="card-container">
        <div class="icon-circle">
            <i class="bi bi-person-check-fill"></i>
        </div>
        <h2>Welcome, <span id="username">User</span>👩🏻‍💼</h2>
        <div class="username-box">
            You Are Successfully Logged In!
        </div>
        <a href="log_reg.html">
            <button class="logout-btn">
                Logout <i class="bi bi-box-arrow-in-right"></i>
            </button>
        </a>
    </div>
</body>
</html>

Welcome Page Structure:

  • Bootstrap Icons: We have selected a Bootstrap Icons CDN so that we have a professional looking icon, and we don’t have to create a graphics package.
  • Icon Circle: Within it has a checkmark icon to visually indicate that the user has logged in successfully.
  • Dynamic Username: We will set the <span id=”username”> with JavaScript to show the actual username of the customer.
  • Logout link: To return the user back to the login page.

Step 14: Styling the Welcome Page with Glassmorphism

🌐
body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(145deg, rgb(5, 5, 111), rgb(19, 130, 167));
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-container {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  border-radius: 20px;
  padding: 40px;
  color: white;
  text-align: center;
}

.icon-circle {
  background-color: rgba(255, 255, 255, 0.2);
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 20px;
  font-size: 50px;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.3);
}

Modern Design Techniques:

  • Gradient Background: Creates a vibrant, eye-catching backdrop using multiple colors.
  • Glassmorphism: The combination of rgba(255, 255, 255, 0.1) background and backdrop-filter: blur(16px) creates a frosted glass effect—a trendy modern design pattern.
  • Inset Box Shadow: Creates depth inside the icon circle, making it look pressed or carved into the surface.

     

Pro Tip: Glassmorphism works best with semi-transparent backgrounds over colorful gradients!

Design Practices:

  • Gradient Background: Makes a lively, colorful background design with multiple colors.
  • Glassmorphism: An rgba (255, 255, 255, 0.1) background combined with backdrop-filter: blur(16px) results in a frosted glass appearance, a fashionable modern design technique.
  • Inset Box Shadow: Places depth inside of the icon circle, giving the impression it has been pressed or carved into the material’s surface.

     

Pro Tip: Glassmorphism tends to look best with colorful gradients and on a semi-transparent background!

Step 15: Styling the Logout Button

🌐
.logout-btn {
  background-color: #fff;
  color: rgb(6, 6, 162);
  font-weight: 600;
  border: none;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 5px 20px rgba(255, 255, 255, 0.2);
}

.logout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 25px rgba(255, 255, 255, 0.3);
}

Button Movement:

  • Pill Shape: border-radius: 50px produces every corner of the button 100% rounded. 
  • Hover Effect: The button is animated to move a little upward with translateY(-2px) upon hover, yielding the look of being “lifted.”
  • Shadow Growth: The box shadow will grow or enlarge on hover, adding to the 3D effect.

Code Explanation Sections

Login Page Component

The login page is the entry point for our application. It has a basic two-field form (username/email and password), which is contained in a centered container. The main functionality here is the in-line JavaScript in the “Register” link: 

onclick=”document.getElementById(‘modal’).classList.add(‘active’)”

This JavaScript code:

  1. Finds the modal element by its ID
  2. Gets its classList (list of CSS class names)
  3. It adds the “active” class, which calls the CSS and will show the modal. 

Why this method? For simple show/hide functionality, this inline JavaScript is perfectly fine, and for even more complex applications, you would have your JavaScript in its own file.

Registration Modal Component

The modal uses a full screen overlay pattern. While inactive, it has display: none. Once the “active” class is applied:

  1. The modal now has display: flex
  2. The dark background (rgba) covers the entire screen.
  3. The white form container is centered with Flexbox.
  4. Users are allowed to scroll if they are on a short screen height and the form is taller than the viewport.

The close button will work inversely: 

onclick=”document.getElementById(‘modal’).classList.remove(‘active’)”

This will remove the “active” class and hide the modal.

Form Validation Flow

HTML5 makes built-in validation possible with some attributes: 

required: This field must be filled before they can submit.

type=”email”: Must have @ and domain structure.

type=”number”: Will only accept numeric values.

min/max: Limits for numbers and dates.

Once a user presses “Submit”, the browser will:

  • Confirm that all required fields are filled out
  • Validate that each field matches the type constraints of visibility
  • Show error messages for any invalid inputs
  • Only submit if all validation passes

Responsive Grid System

The registration form uses CSS Grid with breakpoints:

Desktop (>900px): 3 columns
grid-template-columns: repeat(3, 1fr);

Tablet (600-900px): 2 columns

grid-template-columns: repeat(2, 1fr);

Mobile (<600px): 1 column
grid-template-columns: 1fr;

This guarantees the best layout at any screen size, avoiding horizontal scrolling.

🌐
<div class="row">
  <div class="half">
    <label>👩🏻‍💼 First Name:</label>
    <input type="text" placeholder="Your First Name" required>
  </div>
  
  <div class="half">
    <label>👩🏻‍💼 Last Name:</label>
    <input type="text" placeholder="Your Last Name" required>
  </div>
  
  <div class="half">
    <label>📧 Email:</label>
    <input type="email" placeholder="Enter Email ID" required>
  </div>
  
  <div class="half">
    <label>🔒 Password:</label>
    <input type="password" placeholder="Enter Password" required>
  </div>
  
  <div class="half">
    <label>✅ Confirm Password:</label>
    <input type="password" placeholder="Confirm Password" required>
  </div>
</div>
🌐
<div class="half">
  <label class="gender-label">⚧️ Gender:</label>
  <div class="gender-group">
    <label><input type="radio" name="gender" value="male" required> Male</label>
    <label><input type="radio" name="gender" value="female" required> Female</label>
    <label><input type="radio" name="gender" value="other" required> Other</label>
  </div>
</div>
🌐
<div class="half">
  <label>🔢 Age:</label>
  <input type="number" placeholder="Your Age" required>
</div>

<div class="half">
  <label>📞 Phone:</label>
  <input type="tel" placeholder="Phone Number" required>
</div>

<div class="half">
  <label>🎂 Date of Birth:</label>
  <input type="date" required>
</div>

<div class="half">
  <label>🕰️ Contact Time:</label>
  <input type="time">
</div>

<div class="half">
  <label>📝 Resume:</label>
  <input type="file">
</div>

<div class="half">
  <label>😊 Satisfaction (1–10):</label>
  <input type="range" min="1" max="10">
</div>
🌐
<div class="checkbox-container">
  <input type="checkbox" required>
  <label>I agree to the terms & conditions</label>
</div>

<input type="hidden" value="student">

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

<p>Already have an account? 
  <a onclick="document.getElementById('modal').classList.remove('active')">
    Login
  </a>
</p>
🌐
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: blue;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.form-container {
  background: white;
  padding: 40px 30px;
  border-radius: 8px;
  box-shadow: 0 6px 13px rgba(0, 0, 0, 0.3);
  width: 350px;
}
🌐
h1 {
  text-align: center;
  margin-bottom: 20px;
}

label {
  display: block;
  margin-top: 15px;
  font-weight: 500;
}

input, select, textarea {
  width: 100%;
  padding: 8px;
  margin-top: 5px;
  border-radius: 6px;
  border: 1px solid black;
  background-color: #fff6f6;
  transition: 0.3s;
}

input:focus, select:focus, textarea:focus {
  background-color: #eef7ff;
  outline: none;
}
🌐
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Welcome To Home Page</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" 
          rel="stylesheet" />
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css" 
          rel="stylesheet" />
    <link rel="stylesheet" href="home.css">
</head>
<body>
    <div class="card-container">
        <div class="icon-circle">
            <i class="bi bi-person-check-fill"></i>
        </div>
        <h2>Welcome, <span id="username">User</span>👩🏻‍💼</h2>
        <div class="username-box">
            You Are Successfully Logged In!
        </div>
        <a href="log_reg.html">
            <button class="logout-btn">
                Logout <i class="bi bi-box-arrow-in-right"></i>
            </button>
        </a>
    </div>
</body>
</html>

Tables of Key Concepts

A. Components / Keywords Used

Name

Description

<form>

Container for user input elements that can be submitted

<input>

Creates interactive fields for user data entry

<label>

Describes the purpose of an input field for accessibility

<select>

Creates a dropdown menu with multiple options

<option>

Individual choices within a select dropdown

<textarea>

Multi-line text input field for longer content

<button>

Clickable element that triggers form submission or actions

type=”text”

Standard single-line text input

type=”email”

Email input with built-in format validation

type=”password”

Masked text input for secure password entry

type=”radio”

Single-selection option button within a group

type=”checkbox”

Toggle option that can be checked or unchecked

type=”number”

Numeric input with up/down spinner controls

type=”date”

Date picker input with calendar interface

type=”time”

Time selector for hours and minutes

type=”file”

File upload button for selecting documents

type=”range”

Slider control for selecting values within a range

type=”hidden”

Invisible field that stores data for submission

onclick

JavaScript event that triggers when element is clicked

classList.add()

JavaScript method to add CSS class to an element

classList.remove()

JavaScript method to remove CSS class from an element

required

HTML attribute that makes field mandatory

placeholder

Hint text displayed inside empty input fields

.modal

CSS class creating full-screen overlay for popups

position: fixed

CSS positioning that fixes element relative to viewport

z-index

CSS property controlling element stacking order

display: grid

CSS layout system for two-dimensional layouts

backdrop-filter

CSS property that applies effects to background

@media

CSS rule for applying styles at specific screen sizes

B. Key Properties / Parameters / Features

Name

Description

action

URL where form data is sent upon submission

name

Identifier for form data when submitted to server

id

Unique identifier for accessing element via JavaScript

value

Data associated with form element when submitted

min / max

Minimum and maximum values for numeric/date inputs

disabled

Makes element unselectable (used for dropdown placeholders)

selected

Marks dropdown option as default choice

accent-color

CSS property that customizes radio/checkbox colors

box-sizing: border-box

Includes padding and border in element’s width calculation

flex

CSS display value enabling flexible box layout

grid-template-columns

Defines number and size of columns in grid layout

gap

Spacing between grid or flex items

rgba()

Color format with red, green, blue, and alpha (transparency)

transition

CSS property for smooth animations between states

border-radius

CSS property that rounds element corners

box-shadow

Creates shadow effects to add depth to elements

backdrop-filter: blur()

Blurs content behind element (glassmorphism effect)

overflow-y: scroll

Adds vertical scrollbar when content exceeds height

transform: translateY()

Moves element vertically without affecting layout

:hover

CSS pseudo-class for styling element when cursor hovers

:focus

CSS pseudo-class for styling element when selected

repeat()

CSS grid function for repeating column/row patterns

1fr

CSS grid unit representing one fraction of available space

vh / vw

Viewport height/width units (1vh = 1% of viewport height)

linear-gradient()

Creates gradient background with multiple colors

What You Learned (Summary)

Congratulations!  You have just built a complete authentication system from scratch. Here is a summary of everything you’ve learned:

Key Takeaways:

1. HTML Forms: You learned how to set up forms that include multiple input types, including text, email, password, radio buttons, checkboxes, dropdowns, file uploads, and specialized inputs, such as date, time, and range sliders.

2. Modal Popups: You built an interactive modal overlay using CSS positioning and JavaScript class manipulation – a pattern used across many high-end websites in the industry. 

3. CSS Grid & Flexbox: You implemented the modern CSS layout systems to build responsive multi-column forms that are flexible to every screen size.

4. Form Validation: You used built-in HTML5 validation via the required attribute, and type specific validation, ensuring data integrity without implementing javascript to build a validation routine. 

5. Responsive Design: Media queries were used to add breakpoints to organize layouts for desktop, tablet, and mobile devices to improve layout on every screen size. 

6. Modern Styling Techniques: You explored modern design patterns like glassmorphism, gradient backgrounds, smooth move transitions and hover states. 

7. User Experience: You learned how to indicate visual feedback, via focus states, hover states and success pages – key features in quality web applications.

Useful References

Expand your knowledge with these excellent resources:

HTML & Forms

CSS Styling

Responsive Design

Practice & Build

Source Code – Complete Login  Registration form using Html and CSS:

Output:

Frequently Asked Questions FAQs

The login and registration page allows users to create an account (sign up) and log into their account (sign in) securely with their credentials, including emails and password. It is a key aspect of any site that personalizes the user experience or stores user identity.

Yes, you can create and design the frontend (what the user sees) using just HTML and CSS. However, you would need a backend language such as PHP, Node.js, or Python, and a database such as MySQL, to make it functional (such as verifying user's credentials or saving data).

Login Form: Allows existing users to sign in with their credentials.

Registration Form: Allows new users to create an account by providing their name, email, and password.

Both Forms typically have similar input fields but serve different purposes.

Yes! You may add subtle animations to your pages using CSS transitions or keyframes to fade a form in/out, or to animate buttons on hover. This will affect the user's perceptions and provide your page with a modern feel.

Yes, but it requires some work with the backend. You could simply add social-login buttons (such as Google, Facebook, GitHub) with the integration of an API (such as OAuth 2.0). You can style the buttons with CSS on the frontend, which is pretty straightforward and will fit right in the UI.