0

我试图将我的下拉列表与导航栏的右侧部分对齐,但失败了,我尝试了很多方法来做到这一点,在所有方面我都失败了。如果有任何方法可以解决这个问题,请帮助我,在此先感谢。

<?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>
4

1 回答 1

0

html 看起来无效。我看不到您的所有代码,但似乎您在 ap 标记内的结束 ul 标记之后有一个结束 li 标记?li 只能在 ul 或 ol 标签内。确保 html 正确,然后重试!希望这可以帮助!

于 2013-08-02T16:51:23.153 回答