Create a red color alert box that indicates a dangerous action in Bootstrap


Use the .alert-danger class in Bootstrap to create a red color alert box indicating dangerous action.

You can try to run the following code to implement .alert-danger class −

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
   <title>Bootstrap Example</title>
      <link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css">
      <script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
      <script src = "https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
   </head>
   <body>
      <div class = "container">
         <div class = "alert alert-danger">
            <p>Danger!</p>
            <p>Add dangerous action here...</p>
         </div>
     </div>
   </body>
</html>

Updated on: 15-Jun-2020

534 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements