The collapse JavaScript plugin is used to show and hide content. Buttons or anchors are used as triggers that are mapped to specific elements you toggle. Collapsing an element will animate the height from it’s current value to 0. Given how CSS handles animations, you cannot use padding on a .collapse element. Instead, use the class as an independent wrapping element.
Click the buttons below to show and hide another element via class changes:
You can use a link with the href attribute, or a button with the data-target attribute. In both cases, the data-toggle="collapse" is required.