我尝试在 Bootstrap 中使用 Collapse元素,但我有一点问题。
这是一个例子
我尝试将我的文本与我的按钮垃圾对齐在同一行中。如您所见,它发生了变化。
如何解决这个问题呢?
<form method="post" action="wbx.php">
<div class="accordion" id="accordion2">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
Collapsible Group Item #1
</a>
<button class="btn btn-danger pull-right" type="submit" name="supprAlias" value="'.$idValue.'">
<i class="icon-trash icon-white"></i>
</button>
</div>
<div id="collapseOne" class="accordion-body collapse in">
<div class="accordion-inner">
Anim pariatur cliche...
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
Collapsible Group Item #2</a>
<button class="btn btn-danger pull-right" type="submit" name="supprAlias" value="'.$idValue.'">
<i class="icon-trash icon-white"></i>
</button>
</div>
<div id="collapseTwo" class="accordion-body collapse">
<div class="accordion-inner">
Anim pariatur cliche...
</div>
</div>
</div>
</div>
</form>
在另一个页面的我的控制器中:
if(!empty($_POST['supprUserAlias']))
{
$savant->deletesUserAlias = $gemel->setDeleteUserAlias($_POST['supprUserAlias'], $username, $domain, $serverMail);
header('Location: wbx.php?user='.$username.'#alias');
exit;
}
编辑
最后找到解决方案:
普<button>
之间<div class="accordion-group">
和<div class="accordion-heading">
<form method="post" action="wbx.php">
<div class="accordion" id="accordion2">
<div class="accordion-group">
<button class="btn btn-danger pull-right" type="submit" name="supprAlias" value="'.$idValue.'">
<i class="icon-trash icon-white"></i>
</button>
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
Collapsible Group Item #1
</a>
</div>
<div id="collapseOne" class="accordion-body collapse in">
<div class="accordion-inner">
Anim pariatur cliche...
</div>
</div>
</div>