ShapeYourPath
(current)
Run Code
Live Code Editor- Bootstrap 4 Close Alert Box
Source Code
<html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <!-- Bootstrap CSS --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css"> <title>Bootstrap 4 Close Alert Box</title> </head> <body> <div class="container my-5 text-center"> <h1 class="my-3">Bootstrap 4 Close Alert Box</h1> <p> In this example, you will learn and understand how to create a Bootstrap 4 closing alert box. It is dismissed from the page after clicking on the close button. </p> <div class="alert alert-success alert-dismissible"> <button type="button" class="close" data-dismiss="alert">×</button> <strong>Success!</strong> A success alert box with close button. </div> <div class="alert alert-warning alert-dismissible"> <button type="button" class="close" data-dismiss="alert">×</button> <strong>Warning!</strong> A warning alert box with close button. </div> </div> <!--/container--> <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.min.js"></script> </body> </html>
Output :
Running