What is the correct way to create a form with input like the one in the example with proper spacing between each input row?
What am I missing here?
http://bootply.com/98917
using . form-group{ margin-bottom: 20px;} works, but best to use bootstrap's builtin and put .
The simplest way to add a space in HTML (besides hitting the spacebar) is with the non-breaking space entity, written as or  . Multiple adjacent non-breaking spaces won't be collapsed by the browser, letting you “force” several visible spaces between words or other page elements.
You can use offsets to make a column appear centered, just use an offset equal to half of the remaining size of the row, in your case I would suggest using col-lg-4 with col-lg-offset-4 , that's (12-4)/2 .
Bootstrap 4 Input Groups input-group class is a container to enhance an input by adding an icon, text or a button in front or behind the input field as a "help text". Use . input-group-prepend to add the help text in front of the input, and . input-group-append to add it behind the input.
You could use form-group
to wrap the labels and inputs.
<div class="form-group"> <label class="control-label col-md-3">X:</label> <div class="input-group col-md-7"> <input class="form-control" type="text"> <span class="input-group-addon">m</span> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Y:</label> <div class="input-group col-md-7"> <input class="form-control" type="text"> <span class="input-group-addon">m</span> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Z:</label> <div class="input-group col-md-7"> <input class="form-control" type="text"> <span class="input-group-addon">m</span> </div> </div>
http://bootply.com/98919
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With