3 回答 3

4

这应该适用于引导程序。我这里没有按钮:

<div class="btn-group">
  <a class="btn">Home</a>
  <a class="btn">Forum</a>
  <a class="btn">Bans</a>
  <a class="btn">Store</a>
  <a href="logout.php" class="btn">Hello username</a>
  <a href="logout.php" class="btn">Log out</a>
  <a href="login.php" class="btn">Log in</a>
</div>
于 2013-08-14T17:32:38.897 回答
2

您将 .btn 类放在<a>标签内。但是,只有当.btn元素是.btn-group. 事实上,规则可能会写成.btn-group > .btn.

.btn类放在您的<a>标签上,甚至删除这个无用的按钮标签,它就会起作用。例如:

<div class="btn-group pull-center" style="text-align:center">
  <a class="btn btn-large btn-primary" type="button">Home</a>
  <a class="btn btn-large btn-primary" type="button">Forum</a>
  <a class="btn btn-large btn-primary" type="button">Bans</a>
  <a class="btn btn-large btn-primary" type="button">Store</a>  
  <a href="" class="btn btn-large btn-primary" type="button">Hello, Username</a>
  <a href="logout.php" class="btn btn-large btn-primary" type="button">Log out</a>
</div>
于 2013-08-14T17:36:04.057 回答
1

不要使用按钮,只需将btn类添加到a标签中即可。例子:

<div class="btn-group pull-center" style="text-align:center">
  <a class="btn btn-large btn-primary">Home</a>
  <a class="btn btn-large btn-primary">Forum</a>
  <a class="btn btn-large btn-primary">Bans</a>
  <a class="btn btn-large btn-primary">Store</a>  
  <a href="logout.php" class="btn btn-large btn-primary">Hello, Username</a>
  <a href="logout.php" class="btn btn-large btn-primary">Log out</a>
  <a href="login.php" class="btn btn-large btn-primary">Log in</a>
</div>

演示

于 2013-08-14T17:35:31.477 回答