aboutsummaryrefslogtreecommitdiff
path: root/docs/components/forms.md
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2017-02-26 17:14:25 -0800
committerMark Otto <[email protected]>2017-02-26 17:14:25 -0800
commit07f63324d1f9447641d6d932872cea05aff5107f (patch)
treead4ed663eec4bfede15dbb70a39d27cea27fad4b /docs/components/forms.md
parentdcd020b3f7bff7bcf07e88ba8cb84676609923d0 (diff)
downloadbootstrap-07f63324d1f9447641d6d932872cea05aff5107f.tar.xz
bootstrap-07f63324d1f9447641d6d932872cea05aff5107f.zip
add more grid layout options
Diffstat (limited to 'docs/components/forms.md')
-rw-r--r--docs/components/forms.md50
1 files changed, 49 insertions, 1 deletions
diff --git a/docs/components/forms.md b/docs/components/forms.md
index 88740acfc..4606fd08d 100644
--- a/docs/components/forms.md
+++ b/docs/components/forms.md
@@ -392,6 +392,55 @@ Be sure to add `.col-form-label` to your `<label>`s as well so they're verticall
</div>
{% endexample %}
+More complex layouts can also be created with the grid system.
+
+{% example html %}
+<div class="container">
+ <form>
+ <div class="row">
+ <div class="form-group col-md-6">
+ <label for="inputEmail4" class="col-form-label">Email</label>
+ <input type="email" class="form-control" id="inputEmail4" placeholder="Email">
+ </div>
+ <div class="form-group col-md-6">
+ <label for="inputPassword4" class="col-form-label">Password</label>
+ <input type="password" class="form-control" id="inputPassword4" placeholder="Password">
+ </div>
+ </div>
+ <div class="form-group">
+ <label for="inputAddress" class="col-form-label">Address</label>
+ <input type="text" class="form-control" id="inputAddress" placeholder="1234 Main St">
+ </div>
+ <div class="form-group">
+ <label for="inputAddress2" class="col-form-label">Address 2</label>
+ <input type="text" class="form-control" id="inputAddress2" placeholder="Apartment, studio, or floor">
+ </div>
+ <div class="row">
+ <div class="form-group col-md-6">
+ <label for="inputCity" class="col-form-label">City</label>
+ <input type="text" class="form-control" id="inputCity">
+ </div>
+ <div class="form-group col-md-4">
+ <label for="inputState" class="col-form-label">State</label>
+ <select id="inputState" class="form-control">Choose</select>
+ </div>
+ <div class="form-group col-md-2">
+ <label for="inputZip" class="col-form-label">Zip</label>
+ <input type="text" class="form-control" id="inputZip">
+ </div>
+ </div>
+ <div class="form-group">
+ <div class="form-check">
+ <label class="form-check-label">
+ <input class="form-check-input" type="checkbox"> Check me out
+ </label>
+ </div>
+ </div>
+ <button type="submit" class="btn btn-primary">Sign in</button>
+ </form>
+</div>
+{% endexample %}
+
Grid-based form layouts also support large and small inputs.
{% example html %}
@@ -413,7 +462,6 @@ Grid-based form layouts also support large and small inputs.
</div>
{% endexample %}
-
## Checkboxes and radios
Default checkboxes and radios are improved upon with the help of `.form-check`, **a single class for both input types that improves the layout and behavior of their HTML elements**. Checkboxes are for selecting one or several options in a list, while radios are for selecting one option from many.