bootstrap navbar下拉列表正在向右对齐

时间:2014-10-04 11:29:40

标签: php jquery html css twitter-bootstrap

需要帮助,我在这里有我的导航栏的代码,有一些PHP代码,一个问题是文本正对齐。我无法找到解决方案。我不能附上CSS。在我发布此帖后,我会附上它。非常感谢那些可以帮助我的人:)

<h1>HTML</h1>
<div class="container">
<nav class="navbar navbar-custom" role="navigation">
<div class="navbar-header">
    <button type ="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
    </button>
    <a class="navbar-brand" href="login_success.php"><img src="litrato/seal.png" HEIGHT="20" WIDTH="20" BORDER="0"></a>
</div>
<div class="navbar-collapse collapse">
    <ul class="nav navbar-nav">
    <li ><a  href="login_success.php">HOME</a> </li>
    <li class="active"><a href="cabecs.php">CABECS</a> </li>
    <li><a  href="nursing.php">CON</a> </li>
    <li><a  href="enginering.php">COE</a> </li>
    <li><a  href="case.php">CASE</a> </li>
    <li><a  href="bed.php">BED</a> </li>
    </ul>

<form class="navbar-form navbar-left" role="search" action='' method='post'>
    <div class="form-group">
      <input type="text" class="form-control" placeholder="Search" name='cisearch'>
    </div>
    <button class="btn btn-default glyphicon glyphicon-search" name='searchcabecs'></button>
  </form>

<?php
include('connect.php');

if(isset($_POST['searchcabecs'])){
echo "<div style=' position:absolute; z-index:1; top:100%; left:21%; height:400%; width:50%; overflow: scroll; overflow-x: hidden; background-color:FFFFFF;'>";
echo"<table border=1 style='position:absolute; z-index:1; top:0%; left:0%; height:2%; width:100%; background-color:FFFFFF;  border:2px solid yellow; border-radius: 3px; '>";
echo "<tr><td>RESULT :<button onclick=\"window.location.href='cabecs.php';\" style=' color:red; float:right;'>x</button></td></tr>";
$csearch = $_POST['cisearch'];

$search = mysql_query("SELECT * FROM addtopic where add_topic  LIKE '%$csearch%' AND department = 'CABECS' ");  

while($rows = mysql_fetch_array($search))
    {
    echo "<tr>";
    echo "<form method='GET' id='view' action= 'view.php' >";
    echo "<input type='hidden' name='supporttype' />";

    echo "<td><div style='width:700px; height:100px;  word-break: break-all; white-space: normal;'><p style='float:left;'></br>TOPIC:  <input type='submit' value='$rows[add_topic]' style='background: #ffffff url(litrato/transparent.png); outline: FFFFFF; background-size: 60px auto; background-size: 100%; border:0; border: none; width:100%; height:100%;'>"."<input type='text' name='topic_id' value='$rows[topic_id]' hidden><input type='text' name='name' value='$name'  hidden> <input type='text' name='addtopic' value='$rows[add_topic]'  hidden>"."</a></p></div></td>";


    echo "</form></tr>";
    }

echo "</table></div>";




}

?>

  <ul class="nav navbar-nav navbar-right">
  <p class="navbar-text navbar-left">Signed in as <?php echo $name?></p>  
    <li><a  href="#" data-toggle="modal" data-target="#myModal">About Us</a> </li>
    <li class="dropdown">
        <a href="#" class="dropdown-toggle glyphicon glyphicon-cog" data-toggle="dropdown"></a>
            <ul class="dropdown-menu" role="menu">
            <li><a href="#">View Profile</a></li>
            <li><a href="#">Edit Profile</a></li>
            <li class="divider"></li>
            <li><a href="logout.php">Log Out</a></li>
            </ul>
        </li>
    </div>
    </ul>
    </div>
    </nav>
    </div>

1 个答案:

答案 0 :(得分:0)

可能是CSS中的text-align或float