删除图像和div之间的额外空间

时间:2013-03-05 17:36:52

标签: html css

如何删除导航横幅和其下方主横幅图像之间的额外空间?

我删除了填充和边距,但没有任何效果。

我的代码如下。

我不想设定职位。谁能告诉我这是什么问题?

<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="http://v2.defie.co/product.html">Product</a></li>
              <li><a href="http://v2.defie.co/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>


<div class="container">
      <header class="hero-unit-product">
        <h1>
            Defie Cloud Business Solutions
            <small>.. changing the way businesses operate.</small>
        </h1>
        <p><a class="btn btn-green btn-large" href="/signup/" data-link="modal" data-target="#signup-modal">Register</a></p>
      </header>
      </div>

2 个答案:

答案 0 :(得分:2)

主要问题与<article class="container">元素有关 - 它有margin-top: 30px;

您还必须更改padding-top选择器的.home。它现在设置为55px,但必须是47px

答案 1 :(得分:2)

空间来自:

.home article.container {
    margin-top: 30px;
}

将其更改为:

.home article.container {
    margin-top: 0;
}