Bootstrap Email Form Example

Ruth Jul 09, 2026

Bootstrap, a popular open-source CSS framework, simplifies responsive web development by providing pre-defined classes for layout, typography, and other design elements. One of its many useful features is the ability to create responsive forms with ease. In this guide, we'll explore an example of creating an email subscription form using Bootstrap.

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 using Bootstrap for forms is beneficial. Bootstrap ensures your forms are mobile-responsive, making them accessible and functional on various devices. It also provides consistent styling and validation, enhancing the user experience and saving you time in development.

a web page with an email box on the bottom right corner and a green envelope in the middle
a web page with an email box on the bottom right corner and a green envelope in the middle

Setting Up the Bootstrap Form

First, include the Bootstrap CSS and JavaScript files in your HTML document. You can use the official Bootstrap CDN for this purpose:

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

<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 the Form Structure

Bootstrap 5 subscribe to our newsletter form with image
Bootstrap 5 subscribe to our newsletter form with image

Now, let's create a simple email subscription form using Bootstrap's grid system and form controls. We'll use the following HTML structure:

<form> <div class="mb-3"> <label for="email" class="form-label">Email address</label> <input type="email" class="form-control" id="email" placeholder="name@example.com"> </div> <button type="submit" class="btn btn-primary">Subscribe</button> </form>

Adding Responsiveness and Styling

an image of some type of webpage with different font and numbers on the page
an image of some type of webpage with different font and numbers on the page

To make the form responsive, we'll use Bootstrap's grid system. We'll wrap the form in a container and use a combination of col- classes to center it on small screens:

<div class="container"> <div class="row justify-content-center"> <div class="col-md-6"> <form> <div class="mb-3"> <label for="email" class="form-label">Email address</label> <input type="email" class="form-control" id="email" placeholder="name@example.com"> </div> <button type="submit" class="btn btn-primary">Subscribe</button> </form> </div> </div> </div>

Adding Form Validation

the landing page for a website with mountains in the background
the landing page for a website with mountains in the background

Bootstrap also provides built-in form validation using HTML5 attributes and JavaScript. Let's add basic email validation to our form:

<div class="mb-3"> <label for="email" class="form-label">Email address</label> <input type="email" class="form-control" id="email" placeholder="name@example.com" required> <div class="invalid-feedback">Please enter a valid email address</div> </div>

Parts of an E-mail exercise
Parts of an E-mail exercise
Bootstrap Modal Popup Form Submit with Ajax & PHP - CodexWorld
Bootstrap Modal Popup Form Submit with Ajax & PHP - CodexWorld
an image of a web page with the wordpress button highlighted
an image of a web page with the wordpress button highlighted
Monthly Overview Email Template
Monthly Overview Email Template
an email form for the website
an email form for the website
the email form for an airbnb account
the email form for an airbnb account
Feature Request Form
Feature Request Form
Unsubscribe Email Template
Unsubscribe Email Template
an invoice form with orange accents on the front and bottom, as well as two
an invoice form with orange accents on the front and bottom, as well as two
an email form with the words thank you for your order
an email form with the words thank you for your order
an email form is shown with the information section highlighted in blue and white, as well as
an email form is shown with the information section highlighted in blue and white, as well as
Confirmation Email Template
Confirmation Email Template
the web page for an ad featuring a man in blue shirt and black t - shirt
the web page for an ad featuring a man in blue shirt and black t - shirt
web simple business email UI design template
web simple business email UI design template
an image of a computer screen with the text'new message'in blue on it
an image of a computer screen with the text'new message'in blue on it
Simple Email Design
Simple Email Design
Free HTML Email Templates from Tabular's Email Builder
Free HTML Email Templates from Tabular's Email Builder
Quality Best Sales Email Templates
Quality Best Sales Email Templates
40 Best Free Inquiry Form Templates 2026 - Colorlib
40 Best Free Inquiry Form Templates 2026 - Colorlib
3 ways email marketing templates make marketing easier (and more effective!)
3 ways email marketing templates make marketing easier (and more effective!)

Enhancing the Form with Tooltips

To provide additional help to users, we can add tooltips to the form fields using Bootstrap's tooltip plugin. First, include the tooltip JavaScript and CSS files:

<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js"></script>

Then, add the tooltip data attributes to the form label:

<label for="email" class="form-label" data-bs-toggle="tooltip" data-bs-placement="top" title="Please enter your email address to subscribe to our newsletter.</label>

With these steps, you've created a responsive, stylish, and functional email subscription form using Bootstrap. This form will provide a seamless user experience across various devices and platforms.