Ask any question about Bootstrap here... and get an instant response.
Post this Question & Answer:
How can I customize the default spacing between Bootstrap form controls?
Asked on Apr 03, 2026
Answer
To customize the default spacing between Bootstrap form controls, you can use Bootstrap's spacing utility classes. These classes allow you to adjust margins and padding easily.
<!-- BEGIN COPY / PASTE -->
<form>
<div class="mb-3">
<label for="exampleInputEmail1" class="form-label">Email address</label>
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp">
</div>
<div class="mb-3">
<label for="exampleInputPassword1" class="form-label">Password</label>
<input type="password" class="form-control" id="exampleInputPassword1">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
<!-- END COPY / PASTE -->Additional Comment:
✅ Answered with Bootstrap 5 best practices.- Use the `mb-3` class to add a bottom margin to each form group, which is a common way to space out form controls.
- Adjust the number in `mb-3` to increase or decrease the spacing (e.g., `mb-4` for more space, `mb-2` for less).
- These utility classes can be applied to any element to control spacing consistently across your form.
Recommended Links:
