如何洗掉手風琴上的 Bootstrap 5 影片(箭頭的旋轉)?
https://getbootstrap.com/docs/5.0/components/accordion/
我試過這個:
.collapsing {
-webkit-transition: none;
transition: none;
display: none;
}
和這個:
.accordion-icon-transform {
rotate(0deg)!important;
}
但似乎兩者都不起作用
uj5u.com熱心網友回復:
您需要將其應用于偽元素.accordion-button::after
,這就是它被添加和轉換的地方。
.accordion-button::after {
transform: none !important;
transition: none !important;
}
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X R7YkIZDRvuzKMRqM OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" crossorigin="anonymous"></script>
<div class="accordion" id="accordionExample">
<div class="accordion-item">
<h2 class="accordion-header" id="headingOne">
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Accordion Item #1
</button>
</h2>
<div id="collapseOne" class="accordion-collapse collapse" aria-labelledby="headingOne" data-bs-parent="#accordionExample">
<div class="accordion-body">
<strong>This is the first item's accordion body.</strong> It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and
hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the <code>.accordion-body</code>, though the transition does limit overflow.
</div>
</div>
</div>
</div>
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/495344.html
上一篇:HTMLCSS卡片重疊