parm530
5/8/2018 - 6:50 PM

BS Forms

Explanation and Syntax for BS Forms

BS Forms

  • Basic form:
<form>
  <!-- Each child div should contain class="form-group"-->
  <div class="form-group">
    <label for="idOfElement"> </label>
    
    <!-- Each input should contain a class="form-control"-->
    <input type="text" class="form-control" id="" placeholder="some text" />
  </div>

</form>
  • Add .inline-form to your form, to make your form span horizontally across the page
  • Always add labels!! To hide the label, add .sr-only
  • Inputs include: text, password, datetime, date, month, time, week, number, email,url, search, tel and color.
  • Elements that can have the .form-control are: input, textarea, select, ...
  • You can change the height of the element by using .input-lg, .input-sm
  • To save code: apply .form-group-lg to make label and element scale large, instead of applying it to the elements individually!