Alerts
Provide contextual feedback messages for typical user actions. Read the Official Bootstrap Documentationfor a full list of instructions and other options.
Default Functionality
Alerts are available for any length of text,as well as an optional dismiss button. For proper styling,use one of the eight required contextual classes.
Alert Link
Use the .alert-link
utility class to quickly provide matching colored links within any alert.
Additional Content
Alerts can also contain additional HTML elements like headings,paragraphs and dividers.
Well done!
Aww yeah,you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.
Whenever you need to,be sure to use margin utilities to keep things nice and tidy.
Dismissing
Using the alert JavaScript plugin,it’s possible to dismiss any alert inline. Add a dismiss button and the .alert-dismissible
class,which adds extra padding to the right of the alert and positions the .close
button.
Outline Styles
An outline style variant with a little thicker border and a little thicker font weight with both border and text have the same color. Use one of the four required contextual classes.
Solid Background
A solid background style variant with white text and without border. Use one of the four required contextual classes.
Alert With Icon
Adding icon to different alert variant using additional class of .d-flex
and .align-items-center
.