Bootstrap Login & Register Form CodePen

Ruth Jul 09, 2026

In the dynamic world of web development, creating responsive and visually appealing login and registration forms is a crucial aspect. Bootstrap, a popular open-source CSS framework, simplifies this process significantly. CodePen, an online code editor and community for front-end developers, offers a platform to experiment and share Bootstrap form codes. Let's delve into creating Bootstrap login and registration forms using CodePen.

Best Free Bootstrap Login Forms » CSS Author
Best Free Bootstrap Login Forms » CSS Author

Before we dive into the code, ensure you have a basic understanding of HTML, CSS, and JavaScript. Familiarity with Bootstrap's grid system and components will also be beneficial. Now, let's explore the step-by-step process of creating these forms.

Free Bootstrap 4 Login Form
Free Bootstrap 4 Login Form

Setting Up the Bootstrap Environment on CodePen

To start, create a new Pen on CodePen. In the layout selection, choose the 'HTML, CSS, JS' layout. Next, add the Bootstrap CDN links in the 'CSS' panel. This will provide the necessary Bootstrap styles for our forms.

login form html css
login form html css

Here's how to add the Bootstrap CDN links:

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>

Creating a Bootstrap Login Form

Login page through HTML and CSS
Login page through HTML and CSS

Let's begin by creating a simple login form. We'll use Bootstrap's form classes and input groups to style our form.

Here's a basic login form structure:

<form>
  <div class="mb-3">
    <label for="exampleInputEmail1" class="form-label">Email address</label>
    <input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp">
    <div id="emailHelp" class="form-text">We'll never share your email with anyone else.</div>
  </div>
  <div class="mb-3">
    <label for="exampleInputPassword1" class="form-label">Password</label>
    <input type="password" class="form-control" id="exampleInputPassword1">
  </div>
  <button type="submit" class="btn btn-primary">Submit</button>
</form>

Creating a Bootstrap Registration Form

55 Best Free Bootstrap Registration Form Designs 2026 - Colorlib
55 Best Free Bootstrap Registration Form Designs 2026 - Colorlib

Now, let's create a registration form that includes fields for name, email, and password. We'll also add a submit button and use Bootstrap's grid system to make the form responsive.

Here's a registration form structure:

<form>
  <div class="row mb-3">
    <div class="col">
      <label for="inputName" class="form-label">Name</label>
      <input type="text" class="form-control" id="inputName">
    </div>
    <div class="col">
      <label for="inputEmail" class="form-label">Email</label>
      <input type="email" class="form-control" id="inputEmail">
    </div>
  </div>
  <div class="mb-3">
    <label for="inputPassword" class="form-label">Password</label>
    <input type="password" class="form-control" id="inputPassword">
  </div>
  <button type="submit" class="btn btn-primary">Submit</button>
</form>

Styling and Validating Forms

the bootstap login and register forms page
the bootstap login and register forms page

Bootstrap provides built-in styles for form controls, but you can further customize them using custom CSS. Additionally, you can use JavaScript or libraries like jQuery to add form validation.

For instance, to add a simple password strength check, you can use JavaScript:

the sign up screen for an app
the sign up screen for an app
the gratify login screen is shown in this screenshote image, it appears to be dark blue
the gratify login screen is shown in this screenshote image, it appears to be dark blue
Bootstrap Responsive Design Registration Form
Bootstrap Responsive Design Registration Form
37 Free Bootstrap Form Templates You Can Try Right Now
37 Free Bootstrap Form Templates You Can Try Right Now
42 Best Free HTML5 And CSS3 Login Forms 2026 - Colorlib
42 Best Free HTML5 And CSS3 Login Forms 2026 - Colorlib
a screen shot of the login page for an email form with a hand holding a dollar sign
a screen shot of the login page for an email form with a hand holding a dollar sign
a green login form on a computer screen
a green login form on a computer screen
the login screen is open and ready to be used for registration or emailing
the login screen is open and ready to be used for registration or emailing
Bootstrap 5 popup form
Bootstrap 5 popup form
Sign in & Sign up in one page with Luxury Design
Sign in & Sign up in one page with Luxury Design
Sign up. Login form. Web login user interface for your mobile app, UI, UX, Registration form
Sign up. Login form. Web login user interface for your mobile app, UI, UX, Registration form
Free Bootstrap Registration Form
Free Bootstrap Registration Form
Login Form Template Bootstrap 5
Login Form Template Bootstrap 5
Registration form | HTML & CSS
Registration form | HTML & CSS
a screen shot of the welcome back page for an email form with green and pink colors
a screen shot of the welcome back page for an email form with green and pink colors
a green and white web page with the words welcome on it's front cover
a green and white web page with the words welcome on it's front cover
the registration form for register now it's completely free, and you can log in
the registration form for register now it's completely free, and you can log in
Bootstrap 5 Login Form Template
Bootstrap 5 Login Form Template
50 Latest & Most Inspiring Login Page Examples and Responsive Templates [FREE DOWNLOAD, Updated 2025]
50 Latest & Most Inspiring Login Page Examples and Responsive Templates [FREE DOWNLOAD, Updated 2025]
Login page UI Design
Login page UI Design

const passwordInput = document.getElementById('inputPassword');
const strengthBar = document.getElementById('strength-bar');

passwordInput.addEventListener('input', () => {
  const password = passwordInput.value;
  let strength = 0;

  if (password.match(/[a-z]+/)) {
    strength++;
  }
  if (password.match(/[A-Z]+/)) {
    strength++;
  }
  if (password.match(/[0-9]+/)) {
    strength++;
  }
  if (password.match(/[$@#&!]+/)) {
    strength++;
  }

  strengthBar.style.width = `${strength * 25}%`;
});

Explore more form customization and validation techniques on the official Bootstrap documentation and through CodePen examples shared by the community.

In the ever-evolving landscape of web development, platforms like CodePen and tools like Bootstrap empower developers to create responsive and visually appealing forms swiftly. Keep practicing and exploring to enhance your skills and stay updated with the latest trends.