]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
custom forms example with new grid styles
authorMark Otto <markdotto@gmail.com>
Sat, 27 May 2017 04:54:35 +0000 (21:54 -0700)
committerMark Otto <markdotto@gmail.com>
Sat, 27 May 2017 04:54:35 +0000 (21:54 -0700)
docs/components/forms.md

index d71615976a72fd7de08695a6a1c01f2058314c77..feadf19bcfbe3f1018f9b9029262cb6cc0e663e9 100644 (file)
@@ -325,6 +325,32 @@ The `.form-group` class is the easiest way to add some structure to forms. Its o
 </form>
 {% endexample %}
 
+{% example html %}
+<form>
+  <div class="row gutters-sm align-items-center">
+    <div class="col-auto">
+      <label class="mr-sm-2" for="inlineFormCustomSelect">Preference</label>
+      <select class="custom-select mb-2 mr-sm-2 mb-sm-0" id="inlineFormCustomSelect">
+        <option selected>Choose...</option>
+        <option value="1">One</option>
+        <option value="2">Two</option>
+        <option value="3">Three</option>
+      </select>
+    </div>
+    <div class="col-auto">
+      <label class="custom-control custom-checkbox mb-2 mr-sm-2 mb-sm-0">
+        <input type="checkbox" class="custom-control-input">
+        <span class="custom-control-indicator"></span>
+        <span class="custom-control-description">Remember my preference</span>
+      </label>
+    </div>
+    <div class="col-auto">
+      <button type="submit" class="btn btn-primary">Submit</button>
+    </div>
+  </div>
+</form>
+{% endexample %}
+
 ### Inline forms
 
 Use the `.form-inline` class to display a series of labels, form controls, and buttons on a single horizontal row. Form controls within inline forms vary slightly from their default states.