我正在使用bootstrap崩溃。我正在尝试折叠第一个元素,但它不起作用。这是我的代码
<li class="c-bg-before-yellow list-group-item c-dropdown" style="font-size: 16px;font-weight:500;">
<a class="analytics collapsed" role="button" data-toggle="collapse" href="#collapseExample" aria-expanded="false" aria-controls="collapseExample">AUDIT & ASSURANCE</a>
<div class="collapse" id="collapseExample" aria-expanded="false" style="height: 0px;">
<ul class="c-dropdown-menu c-content-list-1 c-theme c-square listsss">
<li class="c-bg-before-yellow">
<a href="external_audits.php" class="">External Audits</a>
</li>
<li class="c-bg-before-yellow">
<a href="internal_audits.php" class=" ">Internal Audits</a>
</li>
<li class="c-bg-before-yellow">
<a href="rera_audits.php" class=" ">RERA Audits</a>
</li>
<li class="c-bg-before-yellow">
<a href="agreed_upon_procedures.php" class=" ">Agreed Upon Procedures</a>
</li>
</ul>
</div>
</li>
答案 0 :(得分:0)
默认情况下,它会自动展开。您需要使用手风琴。
<ul>
<li class="accordion" id="accordion2">
<div class="accordion-group">
<div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2"
href="#collapseOne">
AUDIT & ASSURANCE
</a>
</div>
<div id="collapseOne" class="accordion-body collapse in">
<div class="accordion-inner">
<ul class="c-dropdown-menu c-content-list-1 c-theme c-square listsss">
<li class="c-bg-before-yellow">
<a href="external_audits.php" class="">External Audits</a>
</li>
<li class="c-bg-before-yellow">
<a href="internal_audits.php" class=" ">Internal Audits</a>
</li>
<li class="c-bg-before-yellow">
<a href="rera_audits.php" class=" ">RERA Audits</a>
</li>
<li class="c-bg-before-yellow">
<a href="agreed_upon_procedures.php" class=" ">Agreed Upon Procedures</a>
</li>
</ul>
</div>
</div>
</div>
</<li>
</ul>