Then, you can use the following classes to style your form elements:
.form-group
: To wrap form controls and labels.form-control
: To apply styles to form inputs, select, and textarea.form-check
: To style checkboxes and radio buttons.form-check-label
: To style the labels for checkboxes and radio buttons.form-check-input
: To style the inputs for checkboxes and radio buttons
You can also use Bootstrap's grid system to create a custom layout for your form by using classes such as .row
and .col-*
to create rows and columns for your form elements.
Example:
<form> <div class="form-group row"> <label for="inputEmail" class="col-sm-2 col-form-label">Email</label> <div class="col-sm-10"> <input type="email" class="form-control" id="inputEmail" placeholder="Email"> </div> </div> <div class="form-group row"> <label for="inputPassword" class="col-sm-2 col-form-label">Password</label> <div class="col-sm-10"> <input type="password" class="form-control" id="inputPassword" placeholder="Password"> </div> </div> <div class="form-group row"> <div class="col-sm-2"></div> <div class="col-sm-10"> <div class="form-check"> <input class="form-check-input" type="checkbox" id="gridCheck1"> <label class="form-check-label" for="gridCheck1"> Remember me </label> </div> </div> </div> <div class="form-group row"> <div class="col-sm-10"> <button type="submit" class="btn btn-primary">Sign in</button> </div> </div> </form>
Social Plugin