|
| 1 | +<div class="bs-docs-section"> |
| 2 | + <h1 id="alerts" class="page-header">Alerts</h1> |
| 3 | + |
| 4 | + <p class="lead">Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages. For inline dismissal, use the <a href="../javascript/#alerts">alerts jQuery plugin</a>.</p> |
| 5 | + |
| 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> |
| 8 | + |
| 9 | + <div class="bs-callout bs-callout-info"> |
| 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> |
| 12 | + </div> |
| 13 | + |
| 14 | + <div class="bs-example"> |
| 15 | + <div class="alert alert-success" role="alert"> |
| 16 | + <strong>Well done!</strong> You successfully read this important alert message. |
| 17 | + </div> |
| 18 | + <div class="alert alert-info" role="alert"> |
| 19 | + <strong>Heads up!</strong> This alert needs your attention, but it's not super important. |
| 20 | + </div> |
| 21 | + <div class="alert alert-warning" role="alert"> |
| 22 | + <strong>Warning!</strong> Better check yourself, you're not looking too good. |
| 23 | + </div> |
| 24 | + <div class="alert alert-danger" role="alert"> |
| 25 | + <strong>Oh snap!</strong> Change a few things up and try submitting again. |
| 26 | + </div> |
| 27 | + </div> |
| 28 | +{% highlight html %} |
| 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> |
| 33 | +{% endhighlight %} |
| 34 | + |
| 35 | + <h2 id="alerts-dismissable">Dismissable alerts</h2> |
| 36 | + <p>Build on any alert by adding an optional <code>.alert-dismissable</code> and close button.</p> |
| 37 | + <div class="bs-example"> |
| 38 | + <div class="alert alert-warning alert-dismissable" role="alert"> |
| 39 | + <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> |
| 40 | + <strong>Warning!</strong> Better check yourself, you're not looking too good. |
| 41 | + </div> |
| 42 | + </div> |
| 43 | +{% highlight html %} |
| 44 | +<div class="alert alert-warning alert-dismissable" role="alert"> |
| 45 | + <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> |
| 46 | + <strong>Warning!</strong> Better check yourself, you're not looking too good. |
| 47 | +</div> |
| 48 | +{% endhighlight %} |
| 49 | + |
| 50 | + <div class="bs-callout bs-callout-warning"> |
| 51 | + <h4>Ensure proper behavior across all devices</h4> |
| 52 | + <p>Be sure to use the <code><button></code> element with the <code>data-dismiss="alert"</code> data attribute.</p> |
| 53 | + </div> |
| 54 | + |
| 55 | + <h2 id="alerts-links">Links in alerts</h2> |
| 56 | + <p>Use the <code>.alert-link</code> utility class to quickly provide matching colored links within any alert.</p> |
| 57 | + <div class="bs-example"> |
| 58 | + <div class="alert alert-success" role="alert"> |
| 59 | + <strong>Well done!</strong> You successfully read <a href="#" class="alert-link">this important alert message</a>. |
| 60 | + </div> |
| 61 | + <div class="alert alert-info" role="alert"> |
| 62 | + <strong>Heads up!</strong> This <a href="#" class="alert-link">alert needs your attention</a>, but it's not super important. |
| 63 | + </div> |
| 64 | + <div class="alert alert-warning" role="alert"> |
| 65 | + <strong>Warning!</strong> Better check yourself, you're <a href="#" class="alert-link">not looking too good</a>. |
| 66 | + </div> |
| 67 | + <div class="alert alert-danger" role="alert"> |
| 68 | + <strong>Oh snap!</strong> <a href="#" class="alert-link">Change a few things up</a> and try submitting again. |
| 69 | + </div> |
| 70 | + </div> |
| 71 | +{% highlight html %} |
| 72 | +<div class="alert alert-success" role="alert"> |
| 73 | + <a href="#" class="alert-link">...</a> |
| 74 | +</div> |
| 75 | +<div class="alert alert-info" role="alert"> |
| 76 | + <a href="#" class="alert-link">...</a> |
| 77 | +</div> |
| 78 | +<div class="alert alert-warning" role="alert"> |
| 79 | + <a href="#" class="alert-link">...</a> |
| 80 | +</div> |
| 81 | +<div class="alert alert-danger" role="alert"> |
| 82 | + <a href="#" class="alert-link">...</a> |
| 83 | +</div> |
| 84 | +{% endhighlight %} |
| 85 | +</div> |
0 commit comments