× Search
  1. Home
  2. Blog
  3. Gallery
  4. Groups
  5. Features
  6. Pages
  7. Contact us
    Address: Some address goes here
    Phone: +12 345 678 9
    Fax: +12 345 678 9
    Email: email@email.com
    Web: www.webpage.com

    Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica.

Tuesday, January 15, 2019
FeaturesShort CodesAlert Messages

Alert Messages


View Code
<div role="alert" class="alert alert-warning fade in">
      <button data-dismiss="alert" class="close" type="button"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
      <strong>Holy guacamole!</strong> Best check yo self, you're not looking too good.
View Code
<div role="alert" class="alert alert-danger fade in">
      <button data-dismiss="alert" class="close" type="button"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
      <h4>Oh snap! You got an error!</h4>
      <p>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 class="btn btn-danger" type="button">Take this action</button>
        <button class="btn btn-default" type="button">Or do this</button>


Enable dismissal of an alert via JavaScript:



Just add data-dismiss="alert" to your close button to automatically give an alert close functionality.

<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>



Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the .fade and .in class already applied to them.

Closes an alert.



Bootstrap's alert class exposes a few events for hooking into alert functionality.

Event Type Description
close.bs.alert This event fires immediately when the close instance method is called.
closed.bs.alert This event is fired when the alert has been closed (will wait for CSS transitions to complete).
$('#my-alert').on('closed.bs.alert', function () {
  // do something…