BootStrap Mobile Nav格式问题

时间:2014-04-09 17:27:13

标签: html css twitter-bootstrap responsive-design

我有一个超链接旁边的文本,需要在页脚的同一行。当响应没有进入移动模式时,它可以很好地工作。

我拥有navbar-header中的所有代码,inline-block可以正常使用直到移动。

我做错了什么?

页脚HTML:

<div class="navbar navbar-inverse navbar-fixed-bottom">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-2">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <div class='navbar-text' style='margin-left: 15px;'>Test - 426482 - Demo</div>        <ul class='nav navbar-nav'><li style='display: inline-block;'><a href='console.php' target='_blank'>Console</a></li></ul>
            </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-2">
    <ul class='nav navbar-nav'>
          </ul>
    <ul class="nav navbar-nav navbar-right">
                    <div class='form-group'>
            <form action='logout.php' method='post' class='navbar-form ajaxform'>
              <input type='text' name='fullUrl' hidden='true' id='fullUrl' value="">
              <input type="submit" style="clear: left; width: 100%;" class='btn btn-primary'  name="commit" value="Logout" />
            </form>
          </div>
                  </ul>
    </div>
  </div>
</div>

页脚正常版(格式正确): enter image description here

页脚移动版(需要同一行): enter image description here

1 个答案:

答案 0 :(得分:1)

忘记我上面提到的。如果您在“Test - 426482 - Demo”和“Console”上使用navbar-brand类,那么实现您想要的更容易。看看我制作的演示here

编辑:更新了链接here

<div class="navbar navbar-inverse navbar-fixed-bottom">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-2">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
        <span class="navbar-text" style="float: left;">Test - 426482 - Demo</span>
        <a class="navbar-text" style="float: left; margin-left: 15px;" href="console.php" target="_blank">Console</a>
            </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-2">
    <ul class='nav navbar-nav'>
          </ul>
    <ul class="nav navbar-nav navbar-right">
                    <div class='form-group'>
            <form action='logout.php' method='post' class='navbar-form ajaxform'>
              <input type='text' name='fullUrl' hidden='true' id='fullUrl' value="">
              <input type="submit" style="clear: left; width: 100%;" class='btn btn-primary'  name="commit" value="Logout" />
            </form>
          </div>
       </ul>
    </div>
  </div>
</div>