Alerts

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

Example

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.

<div class="alert alert-success" role="alert">
  <strong>Well done!</strong> You successfully read this important alert message.
</div>

<div class="alert alert-info" role="alert">
  <strong>Heads up!</strong> This alert needs your attention, but it's not super important.
</div>

<div class="alert alert-warning" role="alert">
  <strong>Warning!</strong> Better check yourself, you're not looking too good.
</div>

<div class="alert alert-danger m-b-0" role="alert">
  <strong>Oh snap!</strong> Change a few things up and try submitting again.
</div>

Dismissible alerts

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.

<div class="alert alert-warning alert-dismissible show" role="alert">
  <button type="button" class="close" data-dismiss="alert" aria-label="Close">
    <span aria-hidden="true">&times;</span>
  </button>
  <strong>Holy guacamole!</strong> You should check in on some of those fields below.
</div>

<div class="alert alert-danger alert-dismissible fade in" role="alert">
  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
  <div class="p-a-15">
    <h4>Oh snap! You got an error!</h4>
    <p class="m-b-20">Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.</p>
    <button type="button" class="btn btn-danger" data-dismiss="alert" aria-label="Close">Take this action</button>
  </div>
</div>
version: 4.1.2