Bootstrap 4 collapse feature is used to show and hide large amount of information.
<a>
or <button>
to link collapsible element.
data-toggle="collapse"
to either <a>
or <button>
and other data attribute data-target="#id-of-collpasible-element"
to only <button>
while as href="#"
is used by <a>
to link collasible element.
id="id-of-collapse-element"
and .collapse
to the collapsible element .
Note: Bootstrap collapse feature is used to show and hide the text information.
By default, collapsible element is hidden. To show the hidden content, you have to use .show
to collapsible elements(<div>
containing class.collapse
).
Note: In the above example,.show
is applied to show the collapsible element content.