How do you create a form in Bootstrap 5?
<form>
<div class="mb-3">
<label for="e1" class="form-label">Email</label>
<input type="email" class="form-control" id="e1">
</div>
<div class="form-check mb-3">
<input class="form-check-input" type="checkbox" id="k1">
<label class="form-check-label" for="k1">Remember me</label>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
Live preview
The old .form-group is removed in Bootstrap 5. See Forms.
Learn more about the similar topics:
| Tutorials |
|---|
| Bootstrap Forms |
| Bootstrap Input Group and Floating Labels |
| Bootstrap Form Validation |
| Exercises & Assignments |
|---|
| Create a login form with Bootstrap |
| Create a registration form with two columns |
| Validate a required field with Bootstrap |
| Interview Questions & Answers |
|---|
| How do you create a form in Bootstrap 5? |
| How do you validate a form with Bootstrap 5? |