Bootstrap 5: Mastering Horizontal Forms

Ruth Jul 09, 2026

Bootstrap, the popular CSS framework, has always been a go-to for creating responsive and mobile-first websites. With the release of Bootstrap 5, the framework has introduced several improvements, including a revamped form system. One of the standout features is the ability to create horizontal forms with ease. Let's delve into how you can achieve this with Bootstrap 5.

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

Before we dive into the details, it's essential to understand that Bootstrap 5 uses Flexbox for its grid system and components, including forms. This change brings improved responsiveness and better alignment options.

How to Create Form Layouts with Bootstrap 5
How to Create Form Layouts with Bootstrap 5

Creating Horizontal Forms in Bootstrap 5

In Bootstrap 5, creating a horizontal form is as simple as adding a few classes. The framework provides built-in classes for form layout, which we can utilize to create horizontal forms.

Bootstrap 5 Modal Form
Bootstrap 5 Modal Form

First, let's create a basic horizontal form. We'll use the `.row` and `.col` classes for layout, and the `.form-label` and `.form-control` classes for form elements.

Basic Horizontal Form

Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5

Here's a simple example of a horizontal form in Bootstrap 5:

<div class="row mb-3">
  <label for="inputEmail3" class="col-sm-2 col-form-label">Email</label>
  <div class="col-sm-10">
    <input type="email" class="form-control" id="inputEmail3">
  </div>
</div>

The `.row` class creates a new row, and the `.col-sm-2` class makes the label column take up 2 units of the 12-unit grid. The `.col-sm-10` class makes the input column take up the remaining 10 units.

Horizontal Form with Help Text and Validation

Bootstrap 5 popup form
Bootstrap 5 popup form

Bootstrap 5 also provides classes for help text and form validation. Let's add these to our horizontal form:

<div class="row mb-3">
  <label for="inputEmail3" class="col-sm-2 col-form-label">Email</label>
  <div class="col-sm-10">
    <input type="email" class="form-control" id="inputEmail3">
    <div id="emailHelp" class="form-text">We'll never share your email with anyone else.</div>
  </div>
</div>
<div class="row mb-3 was-validated">
  <label for="validationCustom01" class="col-sm-2 col-form-label">First name</label>
  <div class="col-sm-10">
    <input type="text" class="form-control is-invalid" id="validationCustom01" required>
    <div class="invalid-feedback">Please provide a valid first name.</div>
  </div>
</div>

The `.form-text` class is used for help text, and the `.is-invalid` and `.invalid-feedback` classes are used for form validation.

Responsive Horizontal Forms

AdminKit PRO - Bootstrap 5 Admin Template
AdminKit PRO - Bootstrap 5 Admin Template

Bootstrap 5's horizontal forms are responsive by default. The grid system will automatically adjust the layout for different screen sizes. However, you can also manually adjust the layout using the responsive utility classes.

For example, you can use the `.d-none` class to hide an element on small screens, or the `.d-sm-block` class to show an element only on medium or larger screens.

Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Login Form Template Bootstrap 5
Login Form Template Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
the form wizard screen is displayed on an ipad
the form wizard screen is displayed on an ipad
Bootstrap Fieldset Legend: How To + Examples + Template | AZMIND
Bootstrap Fieldset Legend: How To + Examples + Template | AZMIND
an image of a dashboard screen with different colors and numbers on it, as well as the
an image of a dashboard screen with different colors and numbers on it, as well as the
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Premium Bootstrap 5 Admin Template | Azia Template
Premium Bootstrap 5 Admin Template | Azia Template
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
42 Best Free HTML5 And CSS3 Login Forms 2026 - Colorlib
42 Best Free HTML5 And CSS3 Login Forms 2026 - Colorlib
Wizard
Wizard
Ynex - Blazor Server Bootstrap Admin Template
Ynex - Blazor Server Bootstrap Admin Template
Bootstrap Registration Forms: 3 Free Responsive Templates | AZMIND
Bootstrap Registration Forms: 3 Free Responsive Templates | AZMIND
SimpleAdmin: Minimalist Dashboard
SimpleAdmin: Minimalist Dashboard
30 Best Free Bootstrap Wizards & Forms 2026 - Colorlib
30 Best Free Bootstrap Wizards & Forms 2026 - Colorlib
BOOTSTRAP INPUT FORM (2020) | HOW TO MAKE FORM IN BOOTSTRAP
BOOTSTRAP INPUT FORM (2020) | HOW TO MAKE FORM IN BOOTSTRAP
Bootstrap Themes at BootstrapZero
Bootstrap Themes at BootstrapZero
Dolab - Personal Banking Admin Dashboard Bootstrap Template
Dolab - Personal Banking Admin Dashboard Bootstrap Template
25+ Best Free Bootstrap Admin Dashboard Templates — Speckyboy
25+ Best Free Bootstrap Admin Dashboard Templates — Speckyboy
Best Bootstrap Admin Templates with Horizontal Menu and Tips
Best Bootstrap Admin Templates with Horizontal Menu and Tips

Hiding Labels on Small Screens

In some cases, you might want to hide the labels on small screens to save space. Here's how you can do it:

<div class="row mb-3">
  <label for="inputEmail3" class="col-sm-2 col-form-label d-none d-sm-block">Email</label>
  <div class="col-sm-10">
    <input type="email" class="form-control" id="inputEmail3">
  </div>
</div>

In this example, the label is hidden on small screens (below the medium breakpoint) and shown on medium and larger screens.

And there you have it! With these techniques, you can create responsive horizontal forms in Bootstrap 5. Happy coding!