我用Bootstrap创建了一个手风琴链接,我希望手风琴关闭时有一个“Plus”标志,当arcordon打开时我想有一个标识“Less”。这是我的HTML代码:
<div class="panel-group" id="accordion">
<div class="panel panel-default">
<div class="panel-heading">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse1">
<h4 class="panel-title">
<i class="fa fa-object-group fa-lg"></i> Ses contenus <span class="badge">12</span>
<div class="panel-button"><i class="fa fa-minus-circle fa-lg"></i></div>
</h4>
</a>
</div>
<div id="collapse1" class="panel-collapse collapse">
<div class="panel-body"><dd>{{ drupal_view('profil_page_contenu_utilisateur', 'block_1') }}</dd></div>
</div>
</div>
</div>
这是css,但不起作用:
body.path-profile .field--name-dynamic-block-fieldprofile-profil-page-contenu-utilisateur .panel-button div.collapse > a i:before {
content: '\f055';
}
body.path-profile .field--name-dynamic-block-fieldprofile-profil-page-contenu-utilisateur .panel-button div.collapse > a[aria-expanded=true] i:before {
content: '\f056';
}
答案 0 :(得分:0)
答案 1 :(得分:0)
希望这会有所帮助......
#icon{
float: right;
}
&#13;
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>Collapsible Panel</h2>
<p>Click on the collapsible panel to open and close it.</p>
<div class="panel-group">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" href="#collapse1">Collapsible panel<p id="icon"><span class="glyphicon glyphicon-plus"></p></a>
</h4>
</div>
<div id="collapse1" class="panel-collapse collapse">
<div class="panel-body">Panel Body</div>
<div class="panel-footer">Panel Footer</div>
</div>
</div>
</div>
</div>
</body>
</html>
&#13;
{{1}}&#13;