Bootstrap Collapse - Explain Bootstrap's collapsing elements
Bootstrap Collapse
- Collapsible content, add the data-bs-toggle="collapse" attribute to an <a> or a <button> element.
- Click the buttons below to show and hide another element via class changes:
.collapse
hides content..collapsing
is applied during transitions..collapse.show
shows content.
Sample Code
Output
Bootstrap Collapse Horizontal
- Add the
.collapse-horizontal
modifier class to transition the width instead of height and set a width on the immediate child element.
Sample Code
Output
Bootstrap Collapse Multiple targets
- A <button> or <a> can show and hide multiple elements by referencing them with a selector in its href or data-bs-target attribute. Multiple <button> or <a> can show and hide an element if they each reference it with their href or data-bs-target attribute