0

Hello guys i downloaded a bootstrap template and i made to fix the navbar static top. I also decreased the padding-top of every scroll section. I am having a trouble because when i scroll to other page scroll, it covers the head text of the page section. I want to make my navbar larger but i cant because it covers the page scroll. Is there any solution to decrease the scroll down or target it in a division for the page header will not be covered? here is the code :

body {
  width: 100%;
  height: 100%;
}
html {
  width: 100%;
  height: 100%;
}
@media(min-width:767px) {
  .navbar {
    text-align: right;
    padding: 30px 0;
  }
  .top-nav-collapse {
    padding: 0;
  }
}
/* Demo Sections - You can use these as guides or delete them - the scroller will work with any sort of height, fixed, undefined, or percentage based.
    The padding is very important to make sure the scrollspy picks up the right area when scrolled to. Adjust the margin and padding of sections and children 
    of those sections to manage the look and feel of the site. */

.intro-section {
  height: 100%;
  padding-top: 50px;
  text-align: center;
  background: #fff;
}
.about-section {
  height: 100%;
  padding-top: 50px;
  text-align: center;
  background: #eee;
}
.services-section {
  height: 100%;
  padding-top: 50px;
  text-align: center;
  background: #fff;
}
.contact-section {
  height: 100%;
  padding-top: 50px;
  text-align: center;
  background: #eee;
}
<body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top">

  <!-- Navigation -->
  <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
    <div class="container">

      <a class="navbar-brand"><span class="logo"><img class="logo-mob" width="10%" src="images/mylogo.png" alt="mylogo"></span> </a>

      <div class="navbar-header page-scroll">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>

      </div>

      <!-- Collect the nav links, forms, and other content for toggling -->
      <div class="collapse navbar-collapse navbar-ex1-collapse">
        <ul class="nav navbar-nav">
          <!-- Hidden li included to remove active class from about link when scrolled up past about section -->
          <li class="hidden">
            <a class="page-scroll" href="#page-top"></a>
          </li>
          <li>
            <a class="page-scroll" href="#about">About</a>
          </li>
          <li>
            <a class="page-scroll" href="#services">Services</a>
          </li>
          <li>
            <a class="page-scroll" href="#contact">Contact</a>
          </li>
        </ul>
      </div>
      <!-- /.navbar-collapse -->
    </div>
    <!-- /.container -->
  </nav>

  <!-- Intro Section -->
  <section id="intro" class="intro-section">
    <div class="container">
      <div class="row">
        <div class="col-lg-12">
          <h1>Scrolling Nav</h1>
          <p><strong>Usage Instructions:</strong> Make sure to include the <code>scrolling-nav.js</code>, <code>jquery.easing.min.js</code>, and <code>scrolling-nav.css</code> files. To make a link smooth scroll to another section on the page, give the link the <code>.page-scroll</code> class
            and set the link target to a corresponding ID on the page.</p>
          <a class="btn btn-default page-scroll" href="#about">Click Me to Scroll Down!</a>
        </div>
      </div>
    </div>
  </section>

  <!-- About Section -->
  <section id="about" class="about-section">
    <div class="container">
      <div class="row">
        <div class="col-lg-12">
          <h1>About Section</h1>
        </div>
      </div>
    </div>
  </section>

  <!-- Services Section -->
  <section id="services" class="services-section">
    <div class="container">
      <div class="row">
        <div class="col-lg-12">
          <h1>Services Section</h1>
        </div>
      </div>
    </div>
  </section>

  <!-- Contact Section -->
  <section id="contact" class="contact-section">
    <div class="container">
      <div class="row">
        <div class="col-lg-12">
          <h1>Contact Section</h1>
        </div>
      </div>
    </div>
  </section>

  <!-- jQuery -->
  <script src="js/jquery.js"></script>

  <!-- Bootstrap Core JavaScript -->
  <script src="js/bootstrap.min.js"></script>

  <!-- Scrolling Nav JavaScript -->
  <script src="js/jquery.easing.min.js"></script>
  <script src="js/scrolling-nav.js"></script>

</body>
chirag
  • 1,761
  • 1
  • 17
  • 33
Jc John
  • 1,799
  • 2
  • 34
  • 69

0 Answers0