Horizontal Forms in Bootstrap 5: A Comprehensive Guide

Ruth Jul 09, 2026

In the realm of web development, Bootstrap has long been a go-to library for creating responsive and mobile-first websites. With the release of Bootstrap 5, the library has introduced a plethora of new features and improvements, including a revamped form system. One of the standout features of Bootstrap 5's form system is the ability to create horizontal forms with ease.

the homepage for an employee portal with a rocket ship in the background and text that reads, apply as a employee
the homepage for an employee portal with a rocket ship in the background and text that reads, apply as a employee

Horizontal forms, also known as inline forms, can significantly improve the user experience by allowing users to view and interact with form labels and inputs side by side. This can make forms less daunting and more intuitive to fill out. In this article, we'll delve into the intricacies of creating horizontal forms using Bootstrap 5.

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

Understanding Horizontal Forms in Bootstrap 5

Bootstrap 5 introduces a new class, `.row`, to create horizontal forms. This class, when used in conjunction with `.col-` classes, allows you to position form labels and inputs side by side. The `.form-row` class is no longer needed in Bootstrap 5 for horizontal forms.

Wizard
Wizard

To create a horizontal form, you'll need to wrap your form controls in a `.row` class and use `.col-` classes to specify the size of your labels and inputs. The label should be placed in a column with a width of `3` or `2`, while the input should be placed in a column with a width of `9` or `10`.

Creating a Basic Horizontal Form

Bootstrap Forms
Bootstrap Forms

Let's start by creating a basic horizontal form. We'll use the `.col-` classes to position the label and input side by side.

Here's an example of a horizontal form with a text input and a select dropdown:

```html

```

Horizontal Forms with Validation

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

Bootstrap 5 also makes it easy to add validation to your horizontal forms. You can use the `.is-valid` and `.is-invalid` classes to provide visual feedback to the user.

Here's an example of a horizontal form with validation:

```html

We'll never share your email with anyone else.
Please choose a password that's at least 8 characters long.
```

Responsive Horizontal Forms

Bootstrap 5 Modal Form
Bootstrap 5 Modal Form

Bootstrap 5's horizontal forms are responsive by default. This means that they will automatically adjust their layout based on the size of the viewport.

By default, horizontal forms will stack vertically on small screens (less than 576px wide). You can use media queries to change this behavior if needed. For example, you could use the following media query to keep the form horizontal on small screens:

37 Free Bootstrap Form Templates You Can Try Right Now
37 Free Bootstrap Form Templates You Can Try Right Now
Bootstrap Responsive Design Registration Form
Bootstrap Responsive Design Registration Form
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
AdminKit PRO - Bootstrap 5 Admin Template
AdminKit PRO - Bootstrap 5 Admin Template
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap 5 Classes List Cheat Sheet
Bootstrap 5 Classes List Cheat Sheet
BOOTSTRAP INPUT FORM (2020) | HOW TO MAKE FORM IN BOOTSTRAP
BOOTSTRAP INPUT FORM (2020) | HOW TO MAKE FORM IN BOOTSTRAP
HTML Forms Cheat Sheet for Beginners — Simple Guide
HTML Forms Cheat Sheet for Beginners — Simple Guide
55 Best Free Bootstrap Registration Form Designs 2026 - Colorlib
55 Best Free Bootstrap Registration Form Designs 2026 - Colorlib
Bootstrap Registration Forms: 3 Free Responsive Templates | AZMIND
Bootstrap Registration Forms: 3 Free Responsive Templates | AZMIND
40 Best Free Bootstrap Login Form Templates 2026 - Colorlib
40 Best Free Bootstrap Login Form Templates 2026 - Colorlib
an image of a web page with many different things on it, including food and drinks
an image of a web page with many different things on it, including food and drinks
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
How To Center a div Horizontally in Bootstrap 4
How To Center a div Horizontally in Bootstrap 4
Ventic - Event Ticketing Bootstrap 5 Admin Template
Ventic - Event Ticketing Bootstrap 5 Admin Template
Spaner - Bootstrap Admin Panel Dashboard Design Responsive HTML5 Template
Spaner - Bootstrap Admin Panel Dashboard Design Responsive HTML5 Template
Bootstrap 4 Cheat Sheet - The ultimate list of Bootstrap classes
Bootstrap 4 Cheat Sheet - The ultimate list of Bootstrap classes
Ynex - Blazor Server Bootstrap Admin Template
Ynex - Blazor Server Bootstrap Admin Template
Bootstrap Navbar Guide and Free Navigation Examples
Bootstrap Navbar Guide and Free Navigation Examples
SimpleAdmin: Minimalist Dashboard
SimpleAdmin: Minimalist Dashboard

```css @media (max-width: 575.98px) { .horizontal-form .form-label { margin-bottom: 0.5rem; } .horizontal-form .form-control { width: 100%; } } ```

Horizontal Forms with Custom Breakpoints

Bootstrap 5 allows you to create custom breakpoints for your horizontal forms. This can be useful if you want to change the layout of your form at a specific screen width.

To create a custom breakpoint, you can use the `.col-custom` class and specify the width of the column using a value between 1 and 12. For example, the following code creates a horizontal form that will stack vertically at 768px wide screens:

```html

```

In the world of web development, Bootstrap 5's horizontal forms offer a powerful and flexible way to create intuitive and responsive forms. By leveraging the `.row` and `.col-` classes, you can create horizontal forms that enhance the user experience and make your websites stand out.