![]() |
VOOZH | about |
Bootstrap 5 Layout Horizontal form is used to create horizontal forms by using the .row class with .col-*-* classes to specify the width of your labels and controls. Also, use the .col-form-label class with <label> element to set the form label in vertically centered.
Layout Horizontal form used Classes:
Syntax:
<form> <div class="row"> <label for="..." class="col-*-* col-form-label">...</label> <div class="col-*-*"> <input type="..." class="form-control" id="..."> </div> </div> ... </div>
Example 1: In this example, we will create a horizontal form layout.
Output:
Example 2: In this example, we will create a horizontal form layout.
Output:
Reference: https://getbootstrap.com/docs/5.0/forms/layout/#horizontal-form