ShapeYourPath
(current)
Run Code
Live Code Editor- Bootstrap 5 Link With Collapse
Source Code
<!doctype html> <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 href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet"> <title>Bootstrap 5 Link With Collapse Example</title> <style type="text/css"> h4{color:red;font-size: 32px;} </style> </head> <body> <div class="container mt-4"> <h1>Bootstrap 5 Collapse</h1> <a class="btn btn-primary" data-bs-toggle="collapse" href="#collapseExample2" role="button" aria-expanded="false" aria- controls="collapseExample"> Link with href </a> </p> <div class="collapse show" id="collapseExample2"> <div class="card card-body"> This is the body content of the collapsible. It is by default hidden and it will be shown when the user clicks the link. </div> </div> </div><!--/container--> <!-- Option 1: Bootstrap Bundle with Popper --> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js"></script> </body> </html>
Output :
Running