Bootstrap 5 Alerts
Display pre-styled alerts and messages for common user actions.
Bootstrap provides an easy way to create a stylized alert message box with its alert component.
To create an alert box, use the
.alert class along with one of the
.alert-* classes to specify the kind of alert.
You can create dismissible alerts by adding a close button and the
.alert-dismissible class. On the close button, add the
data-bs-dismiss="alert" attribute. Be sure to use the
button element with it for proper behavior across all devices.
You can give the alert a slight fading effect when closing them by adding the
Alerts with Links
.alert-link class on the
a tag to match link color with the text.