Bootstrap Forms: Basics

Bootstrap Framework 10 min min read Updated: Nov 16, 2026 Beginner
Bootstrap Forms: Basics
Beginner Topic 3 of 7

Why Style Forms?

Default browser forms look different in each browser and are not very attractive. Bootstrap makes them consistent, easy to touch on mobile and good-looking.

Your First Form

html <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 class="form-text">We will never share your email.</div> </div> <div class="mb-3"> <label for="msg" class="form-label">Message</label> <textarea class="form-control" id="msg" rows="3"></textarea> </div> <button type="submit" class="btn btn-primary">Send</button> </form>

Main Classes

ClassPurpose
form-labelStyles the label with space below
form-controlStyles text inputs, textareas and file inputs
form-textSmall helper text below an input
mb-3Margin to separate form groups
Important: Always connect a label to its input using for="email" and id="email". Clicking the label then focuses the input, and screen readers can read it properly.
Result

A clean form with a full-width email input, a textarea and a blue Send button.

Sizes

html <input class="form-control form-control-lg" type="text" placeholder="Large"> <input class="form-control" type="text" placeholder="Default"> <input class="form-control form-control-sm" type="text" placeholder="Small">

Disabled and Readonly

html <input class="form-control" type="text" value="Disabled" disabled> <input class="form-control" type="text" value="Readonly" readonly> <input class="form-control-plaintext" type="text" value="email@example.com" readonly>

File Input

html <div class="mb-3"> <label for="upload" class="form-label">Upload photo</label> <input class="form-control" type="file" id="upload"> </div>

Color Picker and Datalist

html <input type="color" class="form-control form-control-color" value="#0d6efd"> <input class="form-control" list="cities" placeholder="Choose a city"> <datalist id="cities"> <option value="Delhi"> <option value="Mumbai"> <option value="Pune"> </datalist>

Common Mistakes

  • Forgetting form-control, so the input has no style and is not full width
  • Using placeholders instead of labels. Placeholders disappear when you type
  • Using wrong input types, such as type="text" for email

Conclusion

A good form is clear, simple and easy to complete. Use labels, form-control and spacing classes for every field.

Quick Summary: form-label + form-control inside a mb-3 wrapper. Add form-text for hints, and form-control-lg or sm for size.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators