css 引导程序折叠面板在使用标题中地折叠图标时出现视觉问题

t5fffqht  于 2022-11-27  发布在  其他
关注(0)|答案(1)|浏览(127)

我使用了一些可折叠的引导面板,在折叠状态下,通过单击标题作为示例,我在标题的右侧有一个图标,它触发了折叠。折叠转换在这样做时有一个视觉问题,正如你在jsfiddle中看到的。它将所有面板主体内容收缩到图标所在的位置。请参见JSFiddle以获得简化的示例。
https://jsfiddle.net/10bLdb5t/3/
谢谢你!
于飞:

<!-- 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>
dced5bon

dced5bon1#

如果添加此样式规则

style="margin-top:-8px;"

到您的a标签,您的问题就解决了。不知道这是否是最好的解决方案,但它确实有效。

相关问题