When using Bootstrap v4, ensure you utilize an accordion as a parent and include data-parent
attribute for the collapsible elements.
For more information, refer to the Bootstrap v4 documentation
<div id="accordion">
<div className="my-2">
<a className="btn btn-success text-start form-control fs-3" data-bs-toggle="collapse" href="#collapseExample"
role="button" aria-expanded="false" aria-controls="collapseExample">
<i className="fas fa-minus"></i> 1. PRODAM10 DAMLA NEDİR?
</a>
<div className="collapse" id="collapseExample" data-parent="#accordion">
<div className="card card-body border-4 fs-4">
lorem ipsum...
</div>
</div>
</div>
<div className="my-2">
<a className="btn btn-success text-start form-control fs-3" data-bs-toggle="collapse" href="#collapseExample2"
role="button" aria-expanded="false" aria-controls="collapseExample2">
<i className="fas fa-minus"></i> 2. Nasıl Etki Eder?
</a>
<div className="collapse" id="collapseExample2" data-parent="#accordion">
<div className="card card-body border-4 fs-4">
lorem ipsum...
</div>
</div>
</div>
</div>
For Bootstrap V5, keep in mind that collapsible and accordion components are distinct. Check out the Bootstrap V5 documentation for more details.
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3f5d50504b4c4b4d5e4f7f0a110f110d">[email protected]</a>/dist/js/bootstrap.bundle.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="16747979626562647766562338263824">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet"/>
<div class="accordion accordion-flush" id="accordionFlushExample">
<div class="accordion-item">
<h2 class="accordion-header" id="flush-headingOne">
<a className="btn btn-success text-start form-control fs-3 accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#flush-collapseOne" href="#flush-collapseOne"
role="button" aria-expanded="false" aria-controls="flush-collapseOne">
<i className="fas fa-minus"></i> 1. PRODAM10 DAMLA NEDİR?
</a>
</h2>
<div id="flush-collapseOne" class="accordion-collapse collapse" aria-labelledby="flush-headingOne" data-bs-parent="#accordionFlushExample">
<div class="accordion-body">lorem ipsum...</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header" id="flush-headingTwo">
<a className="btn btn-success text-start form-control fs-3 accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#flush-collapseTwo" href="#flush-collapseTwo"
role="button" aria-expanded="false" aria-controls="flush-collapseOne">
<i className="fas fa-minus"></i> 2. Nasıl Etki Eder?
</a>
</h2>
<div id="flush-collapseTwo" class="accordion-collapse collapse" aria-labelledby="flush-headingTwo" data-bs-parent="#accordionFlushExample">
<div class="accordion-body">lorem ipsum...</div>
</div>
</div>
</div>