我的这段代码的问题是,当我在按钮周围添加链接时,它会将按钮分开。并且不再将它们全部加入,而不再将它们加入。
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<div class="btn-group" role="group">
<a href="/learn/popular-tags/all"><button type="button" class="btn btn-default <? if ($type == 'all'){ ?>active<? } ?>">All</button></a>
</div>
<div class="btn-group" role="group">
<a href="/learn/popular-tags/male"><button type="button" class="btn btn-default <? if ($type == 'male'){ ?>active<? } ?>">Male</button></a>
</div>
<div class="btn-group" role="group">
<a href="/learn/popular-tags/female"><button type="button" class="btn btn-default <? if ($type == 'female'){ ?>active<? } ?>">Female</button></a>
</div>
<div class="btn-group" role="group">
<a href="/learn/popular-tags/couples"><button type="button" class="btn btn-default <? if ($type == 'couples'){ ?>active<? } ?>">Couples</button></a>
</div>
<div class="btn-group" role="group">
<a href="/learn/popular-tags/trans"><button type="button" class="btn btn-default <? if ($type == 'trans'){ ?>active<? } ?>">Trans</button></a>
</div>
</div>
感谢任何帮助
最佳答案
不必将按钮放在a href
代码中,您可以这样做:
<a href="https://stackoverflow.com" class="btn btn-default">Click here</a>
该链接看起来像一个按钮。
关于css - bootstrap 会分开我的按钮吗?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/36453059/