折叠时增加Boottrap 4卡的高度和宽度?

时间:2018-09-12 12:46:46

标签: html css html5 css3 bootstrap-4

场景:

  • 我有以下包含卡片的部分,
    当我单击卡片标签并同时显示信息(卡片块)时

Todo:


HTML:

<div class="card">
    <div class="card-header">
        <a data-toggle="collapse" href="#test-block" aria-expanded="true" aria-controls="test-block">
            card header
        </a>
    </div>
    <div id="test-block" class="collapse">
        <div class="card-block">
            card block
        </div>
    </div>
</div>

当前场景:

  • 现在只能扩展并显示数据,但不能使宽度和高度增加。

我需要做什么才能得到我想要的?

1 个答案:

答案 0 :(得分:2)

更改Jquery.js上方的bootstrap.js顺序

<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>

<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>

<div id="test-block" class="collapse">
        <div class="card-body">
            card block
        </div>
    </div>

http://jsfiddle.net/5bwryt1g/8/