Bootstrap折叠面板使用折叠图标而不是标题存在视觉问题

时间:2015-03-31 09:51:13

标签: css twitter-bootstrap css-position panel collapse

我正在使用一些可折叠的引导面板并通过单击标题the example来实现折叠,我在标题的右侧有一个触发折叠的图标。崩溃过渡在执行此操作时会出现视觉问题,正如您在jsfiddle中看到的那样。它将所有面板主体内容缩小到图标所在的位置。有关简化示例,请参阅JSFiddle。

https://jsfiddle.net/10bLdb5t/3/

谢谢!

HTML:

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<div class="panel-group">
  <div class="panel panel-default" id="panel1">      
    <div class="panel-heading">
      <a class="btn btn-collapse pull-right" data-toggle="collapse" href="#collapseOne">
        <i class="fa fa-caret-square-o-up"></i>
      </a>
      <h4 class="panel-title">
        Collapsible Group Item #1
      </h4>
    </div>      
    <div id="collapseOne" class="panel-collapse collapse in">
      <div class="panel-body">
        Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
      </div>
    </div>
  </div>
</div>

1 个答案:

答案 0 :(得分:0)

如果添加此样式规则

&#13;
&#13;
style="margin-top:-8px;"
&#13;
&#13;
&#13; 到a标记,您的问题就解决了。不知道它是否是最佳解决方案,但它确实有效。