Using Bootstrap we can easily create predefined alert messages.
This HDMI page on the right side contains an example of commonly used alerts including the success info
warning and danger alert in the source code.
We can see how the alert was created inside our container.
We have a series of div elements 1 2 3 and 4.
The first alert is the success alert.
We've applied the alert class in addition to the alert success class.
We've also inserted the word success inside the alert for the remaining alerts.
All we need to do is swap the alert success with the desired alert type.
For example in the second div we have alert info.
The third is alert warning.
And the fourth is alert danger.
We can make the alert dismissal by adding a few attributes to a link
we'll make the first alert.
This miserable
take the following inside the first div element
adding the class equals close in data dismiss equals alert attributes allow the alert to be dismissed
and to test this will save the document and refresh our web browser.
Now you'll see an x appears on the first alert if you click the X.
The alert is dismissed
we can also add a fade effect when the alert is dismissed and to do that all we have to do is add two
additional classes fade and in so save the file and refresh the page.
And now when we dismiss the alert you'll see it fades out.