Bootstrap 5 Basic
Bootstrap 5 Flexbox
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.
To style a basic input field, add the form-control
class:
Try it yourself
Bootstrap supports all standard HTML input types:
Try it yourself
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. |
Try it yourself
Try it yourself
Bootstrap provides classes for styling validation states:
Class |
Description |
---|---|
is-valid |
Green border for valid input. |
is-invalid |
Red border for invalid input. |
Try it yourself
Try it yourself