# 14.折叠
[toc]{type: "ol", level: [3]}
### 折叠
```html
<p>
<!--链接-->
<a class="btn btn-primary" data-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false"
aria-controls="collapseExample">
Link with href
</a>
<!--按钮-->
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#collapseExample"
aria-expanded="false" aria-controls="collapseExample">
Button with data-target
</button>
</p>
<div class="collapse" id="collapseExample">
<div class="card card-body">
Some placeholder content for the collapse component. This panel is hidden by default but revealed when the user
activates the relevant trigger.
</div>
</div>
```
![折叠-折叠-点击前](14.折叠-折叠-点击前.png)
![折叠-折叠-点击后](14.折叠-折叠-点击后.png)