我试图将我的下拉列表移动到导航栏的右侧部分但是失败了,我已经尝试了很多方法来做到这一点,在所有方面我都失败了。 如果有任何方法可以解决这个问题请有人帮助我,提前谢谢。
<?php
$curdir = getcwd ();
chdir('/forum');
require_once('/global.php');
chdir ($curdir);
$username=$vbulletin->userinfo['username'];
?>
<div class="navbar-wrapper">
<div class="container">
<div class="navbar navbar-inverse">
<div class="navbar-inner">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand" href="/index.php"></p>Name</p></a>
<div class="nav-collapse collapse">
<ul class="nav">
<li>
<a href='/index.php'><img src="/home.png" height="25" width="25"> Home</b></a>
</li>
<li>
<a href='/forum'><img src="/forum.png"> Forum</a>
</li>
<li class='dropdown'>
<a href='#' class='dropdown-toggle' data-toggle='dropdown'><img src="P.png"> Players<b class='caret'></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="action.php"><img src="/action.php"> Action</a>
</li>
</ul>
</li>
<?php if ($vbulletin->userinfo['usergroupid'] == '1' )
echo "
<li class='dropdown'>
<a href='#' class='dropdown-toggle' data-toggle='dropdown'><i class='icon-user icon-white'></i> Welcome Guest<b class='caret'></b>
</a>
<ul class='dropdown-menu'>
<li>
<a href='#'><img src='/img/connectserver.png'> Action</a>
</li>
<li>
<a href='/login.php'><i class='icon-ban-circle'></i> Login</a>
</li>
<li>
<a href='register.php'><i class='icon-ok'></i> Register</a>
</li>
</li>
</ul>
</ul>
</li>";?>
<?if ($vbulletin->userinfo['usergroupid'] != '1' )
echo "
</li>
<li class='dropdown'>
<a href='#' class='dropdown-toggle class='nav pull-right' data-toggle='dropdown'><img src='/img/connectserver.png'></i> Welcome <font color='red'>$username</font><b class='caret'></b>
</a>
<ul class='dropdown-menu'>
<li>
<a href='#'><img src='/img/connect.png' height='19' width='19'> Connect to server</a>
</li>
<!-- <li>
<a href='#'><img src='/log-out.png' height='19' width='19'> Log out</a>
</li> -->
</li>
</ul>
</li></p>";?>
</ul>
</div>
</div>
</div>
</div>
</div>
答案 0 :(得分:0)
html看起来无效。我看不到你的所有代码,但似乎你在p标签内的结束ul标签之后有一个结束的li标签? li只能在ul或ol标签内。确保html正确,然后再试一次!希望这有帮助!