Trying to implement the default collapse feature in Bootstrap 5x specifically for mobile devices. Despite setting up a CSS media query as per my research, the .collapse function doesn't seem to work as intended?
The goal is to have the collapsed DIV item visible only on Mobile and fully displayed on devices wider than 768px. However, currently, it remains collapsed across all devices.
<style>
@media screen and (min-width: 768px){
.collapse {
display: block;
height: auto !important;
visibility: visible;
}
.collapsing{
position: relative;
height: unset !important;
overflow: hidden;
}
}
</style>
<p>
<a class="btn btn-primary" data-bs-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false" aria-controls="collapseExample">
EXAMPLE
</a>
</p>
<div class="collapse" id="collapseExample">
<p>
Some placeholder content for the collapse component.
</p>
</div>
Any insights or suggestions on what might be missing?