Bootstrap Alerts

Bootstrap Alerts allow you to display important messages to users such as warnings, success messages, errors, or information.


Basic Alert

Bootstrap provides different alert classes:

ClassMeaning
alert-successIndicates success (green)
alert-infoInformational message (blue)
alert-warningWarning (yellow)
alert-dangerError or danger (red)
alert-primary, alert-secondary, etc. (Bootstrap 4+)Additional styles

Example:



 

 

 

 


🚫 Dismissible Alert (Close Button)

You can add a close button so users can dismiss alerts.



 


⚠️ Alert with Links

To make links in alerts match the alert style, use alert-link.



 


🎯 Alert with Additional Content (Heading + Text)



 


🔔 JavaScript Custom Alerts (Optional)

Bootstrap alert events can be handled using JS:



 


📌 Summary

FeatureSupported
Basic alert messages✔️
Dismissible alerts✔️
Alerts with links✔️
Alerts with headings✔️
Custom JS alert events✔️

You may also like...