CodesJava

Easy learning with example program codes

Bootstrap 4 Collapse Tutorial

The .collapse class is used for bootstrap collapse functionality. Bootstrap collapse is used when we want to hide and show large amount of content.

Bootstrap 4 Simple Collapsible Example:

<!DOCTYPE html>
<html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
</head>
<body>
 
<div class="container">
  <h2>Bootstrap 4 Simple Collapsible Example</h2>
  <button type="button" class="btn btn-info" data-toggle="collapse" data-target="#demo">Simple collapsible</button>
  <div id="demo" class="collapse">
    The .collapse class is used for bootstrap collapse functionality. Bootstrap collapse is used when we want to hide and show large amount of content. 
  </div>
</div>
 
</body>
</html>

Try it:

JS Bin on jsbin.com

Please follow and like us:
error








Copyright © 2019 CodesJava DMCA.com Protection Status