Bootstrap 5 Horizontal Form Example

Ruth Jul 09, 2026

Bootstrap, the popular CSS framework, has evolved significantly with its latest release, Bootstrap 5. One of the key improvements is the revamped form components, offering more flexibility and better responsiveness. Today, we're going to explore a horizontal form example using Bootstrap 5, a layout that's both visually appealing and functional.

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

Before we dive into the code, let's understand why horizontal forms are useful. They provide a cleaner, more organized layout, especially for complex forms. They also allow for better use of space, making them ideal for larger screens. Now, let's get started with our Bootstrap 5 horizontal form example.

HTML Form Validation with Bootstrap
HTML Form Validation with Bootstrap

Setting Up the Form

First, we need to set up our form using Bootstrap 5's grid system. We'll use the `.row` and `.col` classes to create a two-column layout for our form.

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

Here's a basic structure to start with:

```html

```

Form Groups and Labels

37 Free Bootstrap Form Templates You Can Try Right Now
37 Free Bootstrap Form Templates You Can Try Right Now

In Bootstrap 5, form groups are wrapped in a `.row` with a `.col` for the label and another `.col` for the input. This ensures that the label and input are always aligned horizontally.

Let's add a few more form groups to our example:

```html

```

Adding Form Validation

Bootstrap Fieldset Legend: How To + Examples + Template | AZMIND
Bootstrap Fieldset Legend: How To + Examples + Template | AZMIND

Bootstrap 5 includes built-in form validation. To use it, we just need to add the `is-valid` or `is-invalid` classes to our inputs. Let's add validation to our example:

```html

Please provide a valid email address.
```

Creating a Horizontal Form Layout with Buttons

Now, let's add some buttons to our form. In Bootstrap 5, you can use the `.d-grid` class to make your buttons block-level and full-width within a parent.

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

Here's how you can add submit buttons to our form:

```html

```

Aligning Labels and Inputs

Bootstrap 5 popup form
Bootstrap 5 popup form
the form wizard screen is displayed on an ipad
the form wizard screen is displayed on an ipad
Login Form Template Bootstrap 5
Login Form Template Bootstrap 5
Free 22+ HTML5 Signup & Registration Forms - HTML, CSS
Free 22+ HTML5 Signup & Registration Forms - HTML, CSS
BOOTSTRAP INPUT FORM (2020) | HOW TO MAKE FORM IN BOOTSTRAP
BOOTSTRAP INPUT FORM (2020) | HOW TO MAKE FORM IN BOOTSTRAP
55 Best Free Bootstrap Registration Form Designs 2026 - Colorlib
55 Best Free Bootstrap Registration Form Designs 2026 - Colorlib
30 Best Free Bootstrap Wizards & Forms 2026 - Colorlib
30 Best Free Bootstrap Wizards & Forms 2026 - Colorlib
Tailwind Form with progress bar
Tailwind Form with progress bar
Best Bootstrap Admin Templates with Horizontal Menu and Tips
Best Bootstrap Admin Templates with Horizontal Menu and Tips
100+ Free Bootstrap 5 Templates » CSS Author
100+ Free Bootstrap 5 Templates » CSS Author
Bootstrap Registration Forms: 3 Free Responsive Templates | AZMIND
Bootstrap Registration Forms: 3 Free Responsive Templates | AZMIND
Bootstrap Navbar Guide and Free Navigation Examples
Bootstrap Navbar Guide and Free Navigation Examples
Ventic - Event Ticketing Bootstrap 5 Admin Template
Ventic - Event Ticketing Bootstrap 5 Admin Template
Wizard
Wizard
Bootstrap 5 Modal Login Form
Bootstrap 5 Modal Login Form
25+ Best Free Bootstrap Admin Dashboard Templates — Speckyboy
25+ Best Free Bootstrap Admin Dashboard Templates — Speckyboy
Bootstrap 5 Admin Templates - Minimal
Bootstrap 5 Admin Templates - Minimal
Simple Login Form Free Responsive Widget Template | ThemeVault | ThemeVault
Simple Login Form Free Responsive Widget Template | ThemeVault | ThemeVault
The Best Premium Bootstrap Admin Dashboard Templates
The Best Premium Bootstrap Admin Dashboard Templates
Bootstrap Themes at BootstrapZero
Bootstrap Themes at BootstrapZero

By default, Bootstrap 5 aligns labels and inputs vertically. If you want to align them horizontally, you can use the `.align-items-center` class on the `.row` and add some padding to the label column.

Here's how you can modify our form to achieve this:

```html

```

And that's how you create a horizontal form layout using Bootstrap 5. This layout is not only visually appealing but also highly functional and responsive. Now, go ahead and incorporate this into your projects to enhance the user experience.