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

Basic example

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.
AsciiDoc Code
[alert,success]
.Well done!
--
You successfully read this important alert message.
--
Example 1. Alert with success contextual state class

Well done!

You successfully read this important alert message.

AsciiDoc Code
[alert,info]
.Heads up!
--
This alert needs your attention, but it's not super important.
--
Example 2. Alert with info contextual state class

Heads up!

This alert needs your attention, but it’s not super important.

AsciiDoc Code
[alert,warning]
.Warning!
--
Better check yourself, you're not looking too good.
--
Example 3. Alert with warning contextual state class

Warning!

Better check yourself, you’re not looking too good.

AsciiDoc Code
[alert,danger]
.Oh snap!
--
Change a few things up and try submitting again.
--
Example 4. Alert with danger contextual state class

Oh snap!

Change a few things up and try submitting again.

Dismissable alerts

Build on any alert by setting an optional dismiss option (close button).

AsciiDoc Code
[alert,warning,true]
.Warning!
--
Better check yourself, you're not looking too good.
--
Example 5. Alert with contextual state class

Warning!

Better check yourself, you’re not looking too good.

Learn More

Behind the scene
See
[http://asciidoc.org/userguide.html#X60]
for docfile attribute.

with :

html5 backend
$ asciidoc.py
  -b html5
  -a linkcss
  -a stylesdir=./stylesheets
  -a scriptsdir=./javascripts
  {docfile}
You will have tons of WARNING because AsciiDoc does not support the alert-style open block. But the result is not so bad. Check yourself: select the AsciiDoc entry in Themes menu.
asciidoc: WARNING: alerts.asciidoc: line 35: missing style: [blockdef-open]: alert
asciidoc: WARNING: alerts.asciidoc: line 57: missing style: [blockdef-open]: alert
asciidoc: WARNING: alerts.asciidoc: line 79: missing style: [blockdef-open]: alert
asciidoc: WARNING: alerts.asciidoc: line 101: missing style: [blockdef-open]: alert
asciidoc: WARNING: alerts.asciidoc: line 126: missing style: [blockdef-open]: alert
bootstrap backend
$ asciidoc.py
  -b bootstrap
  -a linkcss
  -a stylesdir=./stylesheets
  -a scriptsdir=./javascripts
  -a theme=flatly
  -a navbar=fixed
  -a totop
  {docfile}
You will have a WARNING because the theme used (e.g. flatly) is a Bootswatch theme, and not a AsciiDoc Theme.
asciidoc: WARNING: missing theme: flatly