书签布局很奇怪

时间:2014-04-16 08:52:25

标签: html css twitter-bootstrap

如您所见,当我点击"关于"重点转移到预期的位置

但"项目"书签超出了我的期望。

enter image description here

enter image description here

内容html

<span id="projects"></span>
<div class="projects">
      <div class="container">
        <h2 class="head">PROJECTS</h2>
      </div>
    </div>

<span id="team"></span>
<div class="team">
      <div class="container">
        <h2 class="head">About Us</h2>
      </div>

导航HTML

<nav class="navbar navbar-inverse navbar-fixed-top" id="navbar-scroll" role="navigation">
      <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
          <button class="navbar-toggle" data-target=".navbar-ex1-collapse" data-toggle="collapse" type="button">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="index.html">VIVOTEK DQA</a>
        </div>
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse navbar-ex1-collapse">
          <ul class="nav navbar-nav navbar-right">
            <li>
              <a href="#home">Home</a>
            </li>
            <li>
              <a href="#service">Service</a>
            </li>
            <!-- %li -->
            <!-- %a{href: "#feature"} Feature -->
            <!-- %li -->
            <!-- %a{href: "#portfolio"} Portfolio -->
            <li>
              <a href="#team">About</a>
            </li>
            <li>
              <a href="#projects">Projects</a>
            </li>
            <!-- %li -->
            <!-- %a{href: "#ptable"} Pricing -->
            <!-- %li -->
            <!-- %a{href: "#contact"} Contact Us -->
            <li>
              <form class="navbar-form navbar-right form-inline" role="search">
                <div class="form-group">
                  <input class="form-control" placeholder="Search any automation tools" type="text">
                  <button class="btn btn-default" type="submit">GO!</button>
                </div>
              </form>
            </li>
          </ul>
        </div>
        <!-- /.navbar-collapse -->
      </div>
    </nav>

2 个答案:

答案 0 :(得分:1)

正如已经提到的,你的CSS很可能是不同的。 没有看到你有没有想过给两个跨度相同的班级?最好是你喜欢的那种?

答案 1 :(得分:0)

对不起我的傻瓜,

我忘了将填充效果添加到项目区域

/* Projects CSS */
.projects{
    padding: 40px 0;
    /*box-shadow: inset 0 0 10px #000;*/
}

其他地区有40px填充