Bootstrap CSS bg-success alert not working
I just spent all day trying to figure out why alert-error
wasn't working, only to realize it's not alert-error, it's alert-danger. Leaving this here in case someone else tortures themselves for hours trying to figure out what's wrong with their Bootstrap 3 alert.
In Bootstrap you have the following pre-defined backgrounds:
Bootstrap 3.1.0:
<div class="bg-primary">...</div>
<div class="bg-success">...</div>
<div class="bg-info">...</div>
<div class="bg-warning">...</div>
<div class="bg-danger">...</div>
Bootstrap 3.0.3:
<div class="alert alert-success">...</div>
<div class="alert alert-info">...</div>
<div class="alert alert-warning">...</div>
<div class="alert alert-danger">...</div>
Bootstrap components
View all Bootstrap components here
Contextual backgrounds bg-primary
, bg-success
, bg-info
, bg-warning
and bg-danger
were added to Bootstrap as of version 3.1.0 and were not present in 3.0.3 and before.
There have however been alert
s with the four contextual classes alert-success
, alert-info
, alert-warning
and alert-danger
which are suitable for that kind of error messages.
<p class="alert alert-danger">There was an error updating your details.</p>
Also see the Bootstrap Alerts Component: http://getbootstrap.com/components/#alerts