0

我只需要知道在哪里更改它以将包括品牌在内的所有内容对齐到左侧。我终生无法在 CSS 中找到它。我想让导航栏更瘦,一切都从最左边对齐,而不是在网页的中心。:/

<div class="navbar navbar-inverse navbar-left navbar-fixed-top">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#"><img src="something.png" /></a>
    </div>
    <div class="navbar-collapse collapse">
      <ul class="nav navbar-nav">
        <li class="active"><a href="#">Home</a></li>
        <li><a href="#about">link</a></li>
        <li><a href="#contact">link</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">Forums <b class="caret"></b></a>
          <ul class="dropdown-menu">
            <li><a href="#">Action</a></li>
            <li><a href="#">Another action</a></li>
            <li><a href="#">Something else here</a></li>
            <li class="divider"></li>
            <li class="dropdown-header">Nav header</li>
            <li><a href="#">Separated link</a></li>
            <li><a href="#">One more separated link</a></li>
          </ul>
        </li>
      </ul>
      <form class="navbar-form navbar-right">
        <div class="form-group">
          <input type="text" placeholder="Email" class="form-control">
        </div>
        <div class="form-group">
          <input type="password" placeholder="Password" class="form-control">
        </div>
        <button type="submit" class="btn btn-success">Sign in</button>
      </form>
    </div><!--/.navbar-collapse -->
  </div>
</div>
4

1 回答 1

1

有这个助手类class="pull-left"可能会帮助你。我第一次错过了bootstrap navbar-component-alignment

但是,如果要对齐导航栏中的下拉菜单项,则应使用 'dropdown-menu-left' 代替 'dropdown-menu' 类引导程序 dropdown-alignment

于 2013-09-05T06:56:19.110 回答