💎 PREMIUM: Bootstrap/bootstrap ref css forms.asp - Full Archive
❮
❯
HTML
CSS
JAVASCRIPT
SQL
PYTHON
JAVA
PHP
HOW TO
W3.CSS
C
C++
C#
BOOTSTRAP
REACT
MYSQL
JQUERY
EXCEL
XML
DJANGO
NUMPY
PANDAS
NODEJS
DSA
TYPESCRIPT
ANGULAR
ANGULARJS
GIT
POSTGRESQL
MONGODB
ASP
AI
R
GO
KOTLIN
SWIFT
SASS
VUE
GEN AI
SCIPY
AWS
CYBERSECURITY
DATA SCIENCE
INTRO TO PROGRAMMING
INTRO TO HTML & CSS
BASH
RUST
TOOLS
Bootstrap 3 Tutorial
BS HOME BS Get Started BS Grid Basic BS Typography BS Tables BS Images BS Jumbotron BS Wells BS Alerts BS Buttons BS Button Groups BS Glyphicons BS Badges/Labels BS Progress Bars BS Pagination BS Pager BS List Groups BS Panels BS Dropdowns BS Collapse BS Tabs/Pills BS Navbar BS Forms BS Inputs BS Inputs 2 BS Input Sizing BS Media Objects BS Carousel BS Modal BS Tooltip BS Popover BS Scrollspy BS Affix BS FiltersBootstrap Grids
BS Grid System BS Stacked/Horizontal BS Grid Small BS Grid Medium BS Grid Large BS Grid ExamplesBootstrap Themes
BS Templates BS Theme "Simply Me" BS Theme "Company" BS Theme "Band"Bootstrap 3 Cert
BS3 CertificateBootstrap Examples
BS Examples BS Editor BS Quiz BS Exercises BS Interview PrepBootstrap CSS Ref
CSS All Classes CSS Typography CSS Buttons CSS Forms CSS Helpers CSS Images CSS Tables CSS Dropdowns CSS Navs GlyphiconsBootstrap JS Ref
JS Affix JS Alert JS Button JS Carousel JS Collapse JS Dropdown JS Modal JS Popover JS Scrollspy JS Tab JS TooltipBootstrap CSS Forms Reference
Bootstrap's Default Settings
Individual form controls automatically receive some global styling with Bootstrap.
All textual <input>, <textarea>, and <select> elements with class="form-control" are set to width: 100%; by default.
Standard rules for all three form layouts:
- Wrap labels and form controls in
<div class="form-group">(needed for optimum spacing) - Add class
.form-controlto all textual<input>,<textarea>, and<select>elements
The following example creates a simple Bootstrap form with two input fields, one checkbox, and a submit button:
Bootstrap Form Example
<form>
<div class="form-group">
<label for="email">Email address:</label>
<input type="email" class="form-control" id="email">
</div>
<div class="form-group">
<label for="pwd">Password:</label>
<input type="password" class="form-control" id="pwd">
</div>
<div class="checkbox">
<label><input type="checkbox"> Remember me</label>
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
Try it Yourself »
Form Classes
| Class | Description | Example |
|---|---|---|
| .form-inline | Makes a <form> left-aligned with inline-block controls (This only applies to forms within viewports that are at least 768px wide) | Try it |
| .form-horizontal | Aligns labels and groups of form controls in a horizontal layout | Try it |
| .form-control | Used on input, textarea, and select elements to span the entire width of the page and make them responsive | Try it |
| .form-control-feedback | Form validation class | Try it |
| .form-control-static | Adds plain text next to a form label within a horizontal form | Try it |
| .form-group | Container for form input and label | Try it |
Input Classes
| Class | Description | Example |
|---|---|---|
| .input-group | Container to enhance an input by adding an icon, text or a button in front or behind it as a "help text" | Try it |
| .input-group-lg | Large input group | Try it |
| .input-group-sm | Small input group | Try it |
| .input-group-addon | Together with the .input-group class, this class makes it possible to add an icon or help text next to the input field | Try it |
| .input-group-btn | Together with the .input-group class, this class attaches a button next to an input. Often used as a search bar | Try it |
| .input-lg | Large input field | Try it |
| .input-sm | Small input field | Try it |
×
Contact Sales
If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com
Report Error
If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com
Top Tutorials
HTML TutorialCSS Tutorial
JavaScript Tutorial
How To Tutorial
SQL Tutorial
Python Tutorial
W3.CSS Tutorial
Bootstrap Tutorial
PHP Tutorial
Java Tutorial
C++ Tutorial
jQuery Tutorial
Top References
HTML ReferenceCSS Reference
JavaScript Reference
SQL Reference
Python Reference
W3.CSS Reference
Bootstrap Reference
PHP Reference
HTML Colors
Java Reference
AngularJS Reference
jQuery Reference
W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning.
Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness
of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookies and privacy policy.
Copyright 1999-2026 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.
Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness
of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookies and privacy policy.
Copyright 1999-2026 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.