8.4.2: how to make a dismissable alert?

Here's a normal alert:
<div class="alert alert-danger">
    <?php echo t('This is an alert'); ?>

How can I make it dismissable?

View Replies:
linuxoid replied on at Permalink Reply
Looks like adding the button does the trick:
<div class="alert alert-success">
    <?php echo t('This is an alert'); ?>
    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
        <span aria-hidden="true">×</span>
MrKDilkington replied on at Permalink Reply
Hi linuxoid,

My reply is a bit late, but you can find more information on notifications in this tutorial.

I wrote the initial version and community member mnakalay expanded on some of the explanations. If you find any information missing, feel free to add to it.
linuxoid replied on at Permalink Reply 1 Attachment
Hi MrKDilkington,

I was wondering about the Bootstrap alert (that kind attached), not a PNotify alert.

As to the PNotify alerts, they only work for registered users. I could not find any easy way of showing them for non-registered users without rewriting them myself from scratch. It would be great if this is not the case and the Howto can be updated.