Alerts

Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.

Basic alert styles

Wrap any text and an optional dismiss button in .alert and one of the four contextual classes (e.g., .alert-success) for basic alert messages. You can also include links by adding the .alert-link class to a tags.

<div class="alert alert-success" role="alert">
  <strong>Well done!</strong>
  You successfully read <a href="#" class="alert-link">this</a> important alert message.
</div>
<div class="alert alert-info" role="alert">
  <strong>Heads up!</strong>
  This alert <a href="#" class="alert-link">needs your attention</a>, but it's not super important.
</div>
<div class="alert alert-warning" role="alert">
  <strong>Warning!</strong>
  Better <a href="#" class="alert-link">check yourself</a>, you're not looking too good.
</div>
<div class="alert alert-danger" role="alert">
  <strong>Oh snap!</strong>
  Change <a href="#" class="alert-link">a few things</a> up and try submitting again.
</div>

Dismissable Alerts

Build on any alert by adding an optional .alert-dismissible and close button.

<div class="alert alert-warning alert-dismissible" role="alert">
  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  <strong>Warning!</strong> Better check yourself, you're not looking too good.
</div>

Optional icons

Use .alert-icon to add an icon based on the contextual class.

<div class="alert alert-info alert-icon alert-dismissible" role="alert">
  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  <strong>Informational!</strong> Feeling smarter already.
</div>
<div class="alert alert-success alert-icon alert-dismissible" role="alert">
  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  <strong>Great succes!</strong> It cannot get any better.
</div>
<div class="alert alert-warning alert-icon alert-dismissible" role="alert">
  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  <strong>Warning!</strong> Perhaps you can save us from catastrophe with this one thing.
</div>
<div class="alert alert-danger alert-icon alert-dismissible" role="alert">
  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  <strong>Error!</strong> What have you done? Computer says no.
</div>

Optional gradient background

When you want to make your alert stand out a little more.

<div class="alert alert-info bg-info-gradient alert-dismissible" role="alert">
  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  <strong>Warning!</strong> Better check yourself, you're not looking too good.
</div>
<div class="alert alert-success bg-success-gradient alert-dismissible" role="alert">
  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  <strong>Warning!</strong> Better check yourself, you're not looking too good.
</div>
<div class="alert alert-warning bg-warning-gradient alert-dismissible" role="alert">
  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  <strong>Warning!</strong> Better check yourself, you're not looking too good.
</div>
<div class="alert alert-danger bg-danger-gradient alert-dismissible" role="alert">
  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  <strong>Warning!</strong> Better check yourself, you're not looking too good.
</div>