1 <div class="bs-docs-section">
2 <h1 id="alerts" class="page-header">Alerts</h1>
4 <p class="lead">Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.</p>
6 <h2 id="alerts-examples">Examples</h2>
7 <p>Wrap any text and an optional dismiss button in <code>.alert</code> and one of the four contextual classes (e.g., <code>.alert-success</code>) for basic alert messages.</p>
9 <div class="bs-callout bs-callout-info" id="callout-alerts-no-default">
10 <h4>No default class</h4>
11 <p>Alerts don't have default classes, only base and modifier classes. A default gray alert doesn't make too much sense, so you're required to specify a type via contextual class. Choose from success, info, warning, or danger.</p>
14 <div class="bs-example" data-example-id="simple-alerts">
15 <div class="alert alert-success" role="alert">
16 <strong>Well done!</strong> You successfully read this important alert message.
18 <div class="alert alert-info" role="alert">
19 <strong>Heads up!</strong> This alert needs your attention, but it's not super important.
21 <div class="alert alert-warning" role="alert">
22 <strong>Warning!</strong> Better check yourself, you're not looking too good.
24 <div class="alert alert-danger" role="alert">
25 <strong>Oh snap!</strong> Change a few things up and try submitting again.
29 <div class="alert alert-success" role="alert">...</div>
30 <div class="alert alert-info" role="alert">...</div>
31 <div class="alert alert-warning" role="alert">...</div>
32 <div class="alert alert-danger" role="alert">...</div>
35 <h2 id="alerts-dismissible">Dismissible alerts</h2>
36 <p>Build on any alert by adding an optional <code>.alert-dismissible</code> and close button.</p>
37 <div class="bs-callout bs-callout-info" id="callout-alerts-dismiss-plugin">
38 <h4>Requires JavaScript alert plugin</h4>
39 <p>For fully functioning, dismissible alerts, you must use the <a href="../javascript/#alerts">alerts JavaScript plugin</a>.</p>
41 <div class="bs-example" data-example-id="dismissible-alert-css">
42 <div class="alert alert-warning alert-dismissible" role="alert">
43 <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
44 <strong>Warning!</strong> Better check yourself, you're not looking too good.
48 <div class="alert alert-warning alert-dismissible" role="alert">
49 <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
50 <strong>Warning!</strong> Better check yourself, you're not looking too good.
54 <div class="bs-callout bs-callout-warning" id="callout-alerts-dismiss-use-button">
55 <h4>Ensure proper behavior across all devices</h4>
56 <p>Be sure to use the <code><button></code> element with the <code>data-dismiss="alert"</code> data attribute.</p>
59 <h2 id="alerts-links">Links in alerts</h2>
60 <p>Use the <code>.alert-link</code> utility class to quickly provide matching colored links within any alert.</p>
61 <div class="bs-example" data-example-id="alerts-with-links">
62 <div class="alert alert-success" role="alert">
63 <strong>Well done!</strong> You successfully read <a href="#" class="alert-link">this important alert message</a>.
65 <div class="alert alert-info" role="alert">
66 <strong>Heads up!</strong> This <a href="#" class="alert-link">alert needs your attention</a>, but it's not super important.
68 <div class="alert alert-warning" role="alert">
69 <strong>Warning!</strong> Better check yourself, you're <a href="#" class="alert-link">not looking too good</a>.
71 <div class="alert alert-danger" role="alert">
72 <strong>Oh snap!</strong> <a href="#" class="alert-link">Change a few things up</a> and try submitting again.
76 <div class="alert alert-success" role="alert">
77 <a href="#" class="alert-link">...</a>
79 <div class="alert alert-info" role="alert">
80 <a href="#" class="alert-link">...</a>
82 <div class="alert alert-warning" role="alert">
83 <a href="#" class="alert-link">...</a>
85 <div class="alert alert-danger" role="alert">
86 <a href="#" class="alert-link">...</a>