markdown Bootstrap折叠

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown Bootstrap折叠相关的知识,希望对你有一定的参考价值。

## Basic Collapsible
Collapsibles are useful when you want to hide and show large amount of content:

### Example
```
<button data-toggle="collapse" data-target="#demo">Collapsible</button>

<div id="demo" class="collapse">
Lorem ipsum dolor text....
</div>
```

The .collapse class indicates a collapsible element (a `<div>` in our example); this is the content that will be shown or hidden with a click of a button.

To control (show/hide) the collapsible content, add the data-toggle="collapse" attribute to an `<a>` or a `<button>` element. Then add the data-target="#id" attribute to connect the button with the collapsible content (`<div id="demo">`).

Note: For `<a>` elements, you can use the href attribute instead of the data-target attribute:

### Example
```
<a href="#demo" data-toggle="collapse">Collapsible</a>

<div id="demo" class="collapse">
Lorem ipsum dolor text....
</div>
```

By default, the collapsible content is hidden. However, you can add the .in class to show the content by default:

### Example
```
<div id="demo" class="collapse in">
Lorem ipsum dolor text....
</div>
```

以上是关于markdown Bootstrap折叠的主要内容,如果未能解决你的问题,请参考以下文章

Bootstrap 折叠复杂行为

确定 Bootstrap 折叠表元素的折叠状态

Bootstrap Collapse 不会自动折叠

使用 Bootstrap 折叠侧边栏

Bootstrap 4:手风琴不会折叠卡片

Bootstrap 3折叠手风琴:折叠所有作品,但在保持数据父级的同时不能全部展开