Advertisement
Google Ad Slot: content-top
Bootstrap 5 Input
In Bootstrap 5, input fields are styled using the form-control class, which makes them responsive and visually appealing with minimal effort. Bootstrap provides various options to customize and enhance input fields.
Basic Input:
To style a basic input field, add the form-control class:
Input Types:
Bootstrap supports all standard HTML input types:
Input Sizes:
Adjust input sizes using the form-control-{size} classes:
Class |
Description |
|---|---|
form-control-lg |
Large input field. |
form-control |
Default input field size. |
form-control-sm |
Small input field. |
Disabled and Readonly Inputs:
Validation States:
Bootstrap provides classes for styling validation states:
Class |
Description |
|---|---|
is-valid |
Green border for valid input. |
is-invalid |
Red border for invalid input. |