Bootstrap 4 Alert Box |
The list of contextual classes are,
- Primary (.alert-primary)
- Secondary (.alert-secondary)
- Success (.alert-success)
- Danger (.alert-danger)
- Warning (.alert-warning)
- Info (.alert-info)
- Light (.alert-light) and
- Dark (.alert-dark)
To create an alert box, include the .alert class in your element followed by any of the contextual classes that are mentioned above.
Let's look into an example,
<div class="alert alert-info" role="alert"> <strong><i class="fa fa-info-circle" aria-hidden="true"></i></strong> Use this alert box when you need to highlight the <b>info</b> message! </div>
Demo
Alert Box (Links)
Include .alert-link class to any of your alert box to create best colored links.Let's put this together into practice,
Alert Box (Dismissible)
The .alert-dismissible class is used to close the alert box with the help of an inline close button.<div class="alert alert-primary alert-dismissible" role="alert">
<strong><i class="fa fa-info-circle" aria-hidden="true"></i></strong>
Use this alert box when you need to highlight the <b>primary</b> message!
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
DemoIf you would like to learn more about bootstrap information click here.
NEXT STEPS...
Increase your brand identity by following the steps outlined above. Ask questions and get feedback on your work by using the below comment section effectively.
Comments