This chapter will cover notifications and the alert classes provided by Bootstrap. Alerts allow you to customise the way you send notifications to your users. They send contextual feedback messages in response to common user behaviours.
To notify, you may add an optional close icon. Use the Alerts jQuery plugin for inline dismissal.
Create a wrapper div> and add a class of.alert and one of the four contextual classes to create a simple alert (e.g., .alert-success, .alert-info, .alert-warning, .alert-danger). This is demonstrated in the following example.
To create a dismissing alert, create a wrapper div> and add a class of.alert as well as one of the four contextual classes (e.g., .alert-success, .alert-info, .alert-warning, .alert-danger)
To the above div> class, add the optional.alert-dismissable class.
Add a button to close the window.
This is demonstrated in the following example:
Add an empty div> with the class.progress-bar within the above div>.
Create a style attribute for the width, which should be given as a percentage. For instance, style = "60 percent" shows that the progress bar was at 60%.
Consider the following example:
A Different Progress Bar
Add a div> with the class.progress to make a progress bar with several styles.
Add an empty div> within the above div> with the class.progress-bar and the class progress-bar-*, where * might indicate success, info, caution, or danger.
Create a style attribute for the width, which should be given as a percentage. For instance, style = "60 percent" shows that the progress bar was at 60%.
Consider the following example:
|