Bootstrap 5 Alerts
Bootstrap 5 Alerts
Bootstrap 5 alerts are used to provide contextual feedback messages for typical user actions with a handful of available and flexible alert messages. Alerts are created with the .alert class.
Bootstrap 5 alerts classes are:-
- .alert-success
- .alert-info
- .alert-warning
- .alert-danger
- .alert-primary
- .alert-secondary
- .alert-light
- .alert-dark
For your Information:-
To close the alert message, add a .alert-dismissible class to the alert container. Then add class="btn-close" and data-bs-dismiss="alert" to a link or a button element. The .fade and .show classes add a fading effect when closing the alert message.