diff --git a/dist/css/bootstrap-flex.css b/dist/css/bootstrap-flex.css index f60a936d86..82c2dd667a 100644 --- a/dist/css/bootstrap-flex.css +++ b/dist/css/bootstrap-flex.css @@ -2565,11 +2565,30 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23d9534f' viewBox='-2 -2 7 7'%3E%3Cpath stroke='%23d9534f' d='M0 0l3 3m0-3L0 3'/%3E%3Ccircle r='.5'/%3E%3Ccircle cx='3' r='.5'/%3E%3Ccircle cy='3' r='.5'/%3E%3Ccircle cx='3' cy='3' r='.5'/%3E%3C/svg%3E"); } +.form-inline { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-flow: row wrap; + -ms-flex-flow: row wrap; + flex-flow: row wrap; +} + @media (min-width: 576px) { .form-inline .form-group { - display: inline-block; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-flex: 0; + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + -webkit-flex-flow: row wrap; + -ms-flex-flow: row wrap; + flex-flow: row wrap; margin-bottom: 0; - vertical-align: middle; } .form-inline .form-control { display: inline-block; @@ -2580,17 +2599,7 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for display: inline-block; } .form-inline .input-group { - display: inline-table; width: auto; - vertical-align: middle; - } - .form-inline .input-group .input-group-addon, - .form-inline .input-group .input-group-btn, - .form-inline .input-group .form-control { - width: auto; - } - .form-inline .input-group > .form-control { - width: 100%; } .form-inline .form-control-label { margin-bottom: 0; diff --git a/dist/css/bootstrap.css b/dist/css/bootstrap.css index 531a029657..d86305c655 100644 --- a/dist/css/bootstrap.css +++ b/dist/css/bootstrap.css @@ -2315,8 +2315,8 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for @media (min-width: 576px) { .form-inline .form-group { display: inline-block; - margin-bottom: 0; vertical-align: middle; + margin-bottom: 0; } .form-inline .form-control { display: inline-block; @@ -2327,8 +2327,8 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for display: inline-block; } .form-inline .input-group { - display: inline-table; width: auto; + display: inline-table; vertical-align: middle; } .form-inline .input-group .input-group-addon, diff --git a/docs/components/forms.md b/docs/components/forms.md index 8915c9e7b2..dd3e0027f6 100644 --- a/docs/components/forms.md +++ b/docs/components/forms.md @@ -274,62 +274,54 @@ The `.form-group` class is the easiest way to add some structure to forms. Its o ### 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 behave differently: +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. -- Controls are `display: inline-block` to provide alignment control via `vertical-align` and `margin`. -- Controls receive `width: auto` to override the Bootstrap default `width: 100%`. -- Controls **only appear inline in viewports that are at least 768px wide** to account for narrow viewports on mobile devices. +- Controls are `display: inline-block` (or `flex` when enabled) to provide alignment control via `vertical-align` and `margin`. Those also means you'll have some HTML character spaces between elements by default. +- Controls and input groups receive `width: auto` to override the Bootstrap default `width: 100%`. +- Controls **only appear inline in viewports that are at least 576px wide** to account for narrow viewports on mobile devices. -Because of this, you may need to manually address the width and alignment of individual form controls. Lastly, as shown below, you should always include a `