首先,我对 HTML 比较陌生,所以这可能很简单。
<div class="btn-group pull-center" style="text-align:center">
<button class="btn btn-large btn-primary" type="button">Home</button>
<button class="btn btn-large btn-primary" type="button">Forum</button>
<button class="btn btn-large btn-primary" type="button">Bans</button>
<button class="btn btn-large btn-primary" type="button">Store</button>
<?php
if($_SESSION['isLogged'] == true) {
$username = $_SESSION['username'];
?> <a href="logout.php"><button class="btn btn-large btn-primary" type="button">Hello, <?php $username ?></button></a>
<a href="logout.php"><button class="btn btn-large btn-primary" type="button">Log out</button></a>
<?php }else {
?> <a href="login.php"><button class="btn btn-large btn-primary" type="button">Log in</button></a><?php
}
?>
</div>
通常 btn-group 类有效并且他们分组。但是,如果我将 A 标记添加到按钮,则该按钮将不会分组。
这是一些截图