![]() |
VOOZH | about |
Bootstrap 5 Alerts are customizable components used to convey important information to users. They come in various styles such as success, warning, danger, and info, providing visual feedback to users based on different actions or states within a web application.
Syntax:
<div class="alert alert-type"> Contents of the alert... <div>Types: There are eight types of alerts available in Bootstrap 5. The classes of these alerts are given below:
Example 1: This example we demonstrates Bootstrap 5 alerts with different colors: primary, secondary, success, and danger, each displaying "GeeksforGeeks" as content.
Output:
Example 2: In this example we features Bootstrap 5 alerts styled as warning, info, light, and dark, displaying "GeeksforGeeks" as content within a centered container.
Output: