0

如何减少导航栏和横幅之间的空白......我减少了填充和边距,但它没有受到影响......在下面提供我的代码......

<div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <a class="btn btn-navbar collapsed" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <a class="brand" href="#" style="padding-top: 0px;">
            <img alt="change" class="defieLogo" src="http://www.defie.co/designerImages/defie_logo_only.png">
          </a>
          <div class="nav-collapse collapse" style="height: 0px;">
            <ul class="nav">
              <li class="active"><a href="/docs/examples/product.html">Product</a></li>
              <li><a href="/docs/examples/solution.html">Solutions</a></li>
              <li><a href="/docs/examples/service.html">Services</a></li>
              <li class="iphonePartnerLink"><a href="/docs/examples/partner.html">Partners</a></li>
              <li class="iphoneContactLink"><a href="/docs/examples/contact.html">Contact</a></li>
            </ul>

            <ul class="nav" id="navSecond">
              <li class=""><a href="/docs/examples/partners.html">Partners</a></li>
              <li><a href="/docs/examples/contact.html">Contact</a></li>
            </ul>
            <form class="navbar-form pull-right">
              <input class="span2" type="text" placeholder="Email">
              <input class="span2" type="password" placeholder="Password">
              <button type="submit" class="btn">Sign in</button>
            </form>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>
4

2 回答 2

2
navbar .navbar-inner {
background: #fff;
color: #000;
box-shadow: none;
-webkit-border-radius: 0;
-moz-border-radius: 0;
-ms-border-radius: 0;
-o-border-radius: 0;
border-radius: 0;
text-shadow: none;
padding: 20px 0 10px;    <--- remove this
}
于 2013-03-04T21:15:09.177 回答
0

将以下 CSS 规则放在 CSS 的末尾。我认为它会解决你的问题。

.home { padding-top: 47px !important; }
.home article.container { margin-top: 0px !important; }
.navbar { height: 47px !important; }
.navbar .brand { padding: 0 20px 10px !imporatnt; }

您正在使用引导响应,请在较小的浏览器宽度中检查您的页面。Bootstrap 正在创建可折叠菜单,在当前背景下似乎不太好!

此外,我建议您不要对引导文件进行更改,这将导致无法更新您的库。相反,您可以覆盖它们。

于 2013-03-04T21:29:16.120 回答