Ray Fitzgerald Ray Fitzgerald - 5 months ago 10
HTML Question

bootstrap site won't scroll

I am making a portfolio webpage on codepen.io . Everything was going fine until now as my page has simply stopped scrolling and I can't find a solution/identity the piece of code that caused the page to stop scrolling.
HERE IS MY CODE:



body {
padding-top: 50px;
}
.intro-text {
font-size: 30px;
}
#About {
height: 500px;
}
#Portfolio {
height: 500px;
}
#Social {
height: 500px;
}

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />

<body data-spy="scroll" data-target=".navbar">
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">

<a href="#" class="navbar-brand">Ray Fitzgerald</a>

<button class="navbar-toggle" data-toggle="collapse" data-target=".navHeaderCollapse">button
</button>

<div class="collapse navbar-collapse navHeaderCollapse">
<ul class="nav navbar-nav">
<li><a href="#About">About</a>
</li>
<li><a href="#Portfolio">Portfollio</a>
</li>
<li><a href="#Social">Social</a>
</li>
</ul>
</div>

</div>

<!-- Main Body & Text Items -->
<div class="container">
<div class="jumbotron">
<div class="intro-text" id="About">
My name is Ray Fitzgerald and I am a young Programmer and Web Developer
</div>
<div class="intro-text" id="Portfolio">
Portfolio
</div>
<div class="intro-text" id="Social">
Social
</div>

</div>
</div>
</nav>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>




Answer

Take the <!-- Main Body & Text Items --> out of the navbar-fixed-top <nav> element.

see fiddle http://jsfiddle.net/85qLh41a/2/

<body data-spy="scroll" data-target=".navbar">
  <nav class="navbar navbar-default navbar-fixed-top">
    <div class="container">

      <a href="#" class="navbar-brand">Ray Fitzgerald</a>

      <button class="navbar-toggle" data-toggle="collapse" data-target=".navHeaderCollapse">button
      </button>

      <div class="collapse navbar-collapse navHeaderCollapse">
        <ul class="nav navbar-nav">
          <li><a href="#About">About</a>
          </li>
          <li><a href="#Portfolio">Portfollio</a>
          </li>
          <li><a href="#Social">Social</a>
          </li>
        </ul>
      </div>

    </div>
  </nav>
   <!-- Main Body & Text Items -->
    <div class="container">
      <div class="jumbotron">
        <div class="intro-text" id="About">
          My name is Ray Fitzgerald and I am a young Programmer and Web Developer
        </div>
        <div class="intro-text" id="Portfolio">
          Portfolio
        </div>
        <div class="intro-text" id="Social">
          Social
        </div>

      </div>
    </div>
</body>
Comments