Bootstrap Input Sizing
✅ 1. Default Input Size
By default, inputs using the .form-control class will take up the full width of their container.
2. Small Input (.form-control-sm)
Use this class for a more compact input field.
3. Large Input (.form-control-lg)
Use this class for a larger, more prominent input field.
4. Custom Width Using Grid or Utilities
If you want to control the width, not just the height (size), you can use:
-
Bootstrap’s grid system
-
Utility classes like
.w-50,.w-75,.w-100, or inline styles
Example using grid:
Example using utility:
5. Sizing in Input Groups
When using .input-group, apply the size class to both .form-control and .input-group.
Summary Table
| Class | Size | Height |
|---|---|---|
.form-control |
Default | Standard |
.form-control-sm |
Small | Reduced |
.form-control-lg |
Large | Increased |
