From the course: Bootstrap 4 Essential Training

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Create alerts

Create alerts - Bootstrap Tutorial

From the course: Bootstrap 4 Essential Training

Start my 1-month free trial

Create alerts

- [Instructor] Alerts are messages with special contextual styles that are designed to display in great looking boxes. They're optionally dismissed and can have any sort of markup so let's take a look at them. Now setting up alerts is pretty simply. You start out with the basic alert class on a container. There's a few contextual classes that you can use for color. So for example, success, info, warning, and danger. A few classes are available for internal content, like headings as well as links. Although you can fit just about any HTML content inside an alert. Now just be aware that it is really meant for very simple content, so don't try too many crazy HTML tags in there. You can choose to dismiss the alerts so that the user can get rid of message. This is how you do that. You add a class of alert-dismissible and then if you want some animation you can also add the fade and show classes. So when you dismiss the alert, it'll have a little animation that fades out. When you do this…

Contents