Use Bootstrap's predefined grid classes to align labels and groups of form controls in a horizontal layout by adding .form-horizontal to the form (which doesn't have to be a
Supported controls
Examples of standard form controls supported in an example form layout.
Inputs
Most common form control, text-based input fields. Includes support for all HTML5 types: text, password, datetime, datetime-local, date, month, time, week, number, email, url, search, tel, and color.
Type declaration required
Inputs will only be fully styled if their type is properly declared.
Input groups
To add integrated text or buttons before and/or after any text-based , check out the input group component.
Textarea
Form control which supports multiple lines of text. Change rows attribute as necessary.
Checkboxes and radios
Checkboxes are for selecting one or several options in a list, while radios are for selecting one option from many.
Disabled checkboxes and radios are supported, but to provide a "not-allowed" cursor on hover of the parent
Option one is this and that—be sure to include why it's great
Option two can be something else and selecting it will deselect option one
Option three is disabled
Inline checkboxes and radios
Use the .checkbox-inline or .radio-inline classes on a series of checkboxes or radios for controls that appear on the same line.
1 2 3
1 2 3
Checkboxes and radios without label text
Should you have no text within the
Selects
Note that many native select menus—namely in Safari and Chrome—have rounded corners that cannot be modified via border-radius properties.
For
Static control
When you need to place plain text next to a form label within a form, use the .form-control-static class on a
.
Email
email@example.com
Password
Email
email@example.com
Password
Focus state
We remove the default outline styles on some form controls and apply a box-shadow in its place for :focus.
Demo :focus state
The above example input uses custom styles in our documentation to demonstrate the :focus state on a .form-control.
Disabled state
Add the disabled boolean attribute on an input to prevent user interactions. Disabled inputs appear lighter and add a not-allowed cursor.
Horizontal form
Use Bootstrap's predefined grid classes to align labels and groups of form controls in a horizontal layout by adding .form-horizontal to the form (which doesn't have to be a
Supported controls
Examples of standard form controls supported in an example form layout. Inputs
Most common form control, text-based input fields. Includes support for all HTML5 types: text, password, datetime, datetime-local, date, month, time, week, number, email, url, search, tel, and color. Type declaration required
Inputs will only be fully styled if their type is properly declared.
Input groups
To add integrated text or buttons before and/or after any text-based , check out the input group component. Textarea
Form control which supports multiple lines of text. Change rows attribute as necessary.
Checkboxes and radios
Checkboxes are for selecting one or several options in a list, while radios are for selecting one option from many.
Disabled checkboxes and radios are supported, but to provide a "not-allowed" cursor on hover of the parent
Option one is this and that—be sure to include why it's great Option two can be something else and selecting it will deselect option one Option three is disabled
Inline checkboxes and radios
Use the .checkbox-inline or .radio-inline classes on a series of checkboxes or radios for controls that appear on the same line. 1 2 3
1 2 3
Checkboxes and radios without label text
Should you have no text within the
Selects
Note that many native select menus—namely in Safari and Chrome—have rounded corners that cannot be modified via border-radius properties.
For
Static control
When you need to place plain text next to a form label within a form, use the .form-control-static class on a
. Email
email@example.com Password
Email
email@example.com Password
Focus state
We remove the default outline styles on some form controls and apply a box-shadow in its place for :focus. Demo :focus state
The above example input uses custom styles in our documentation to demonstrate the :focus state on a .form-control. Disabled state
Add the disabled boolean attribute on an input to prevent user interactions. Disabled inputs appear lighter and add a not-allowed cursor.
Disabled fieldsets
Add the disabled attribute to a