Bootstrap 4 Alerts

The Alert component of Bootstrap is an easy way to create an alert text box. To create an alert box, use .alert class and .alert-* to specify the type of the alert.

Success! You have successfully accomplished something.
Info! This is a ‘just so you know’ message.
Warning! Something went wrong, better take a look.
Watch out! You could be in trouble.

Links within an Alert

.alert-link utility class allows us to create links with matching colors within an alert.

Success! You successfully accomplished something.
Info! This is a ’just so you know’ message.
Warning! Something went wrong better take a look.
Watch out! You could be in trouble.

Dismissable Button

To create a dismissable button using alert component use .alert-dismissableclass.

Use <button> element for proper behavior across all devices. &times is the cross symbol on which we click.

Note: You can give a slight fading effect on closing by giving the classes .fade and .in