右对齐形式旁边的右对齐导航按钮

时间:2015-05-12 12:00:52

标签: html css twitter-bootstrap

我有一个默认的Bootstrap导航栏,右侧对齐的搜索表单和另外几个右对齐的导航按钮。导航按钮应该在搜索表单的右侧,但无论我做什么,它们都在左侧。

我该如何解决?

此:

<?php
  $title = "Map";
  $scriptsH = array('http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js', 'js/showmap.js');
  require_once('header.php');
?>
    <div class="cointainer">
        <div id="map-canvas">
        </div>
  </div>
  <div class="modal fade" id="userDetails" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="userTitle"></h4>
      </div>
      <div class="modal-body">
          <p id="userDesc"></p>
          <p id="userAddr"></p>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary" data-dismiss="modal">Chiudi</button>
    </div>
      </div>
    </div>
  </div>
<?php
  require_once('footer.php');
?>

成为这个:

enter image description here

1 个答案:

答案 0 :(得分:1)

交换位置。

<ul class="nav navbar-nav navbar-right">
  <li><a href="#">Link</a></li>
  <li><a href="#">Link</a></li>
</ul>
<form class="navbar-form navbar-right" role="search">
  <div class="form-group">
    <input type="text" class="form-control" placeholder="Search">
  </div>
  <button type="submit" class="btn btn-default">Submit</button>
</form>

http://jsfiddle.net/timgavin/0Lnqdbd4/