title: How do I fix my slideshow going over my sticky navbar?
body: <p><strong>1)</strong> I followed a tutorial from W3schools for a <a href="https://w3schools.com/howto/howto_js_navbar_sticky.asp" rel="nofollow noreferrer">sticky navbar header</a> and tried making a slideshow underneath it on the home page of my demo website. (For the slideshow, I also followed a <a href="https://w3schools.com/howto/howto_js_slideshow.asp" rel="nofollow noreferrer">W3schools tutorial</a> for it.)</p>
  
  <p>I noticed that whenever I scrolled down to view my content, the slideshow would always overlap and go on top of my sticky navbar header.</p>
  
  <p>Here is a <a href="https://i.stack.imgur.com/sT3mR.png" rel="nofollow noreferrer">screenshot of my problem</a>.</p>
  
  <p><strong>2)</strong> Also, how do I center the links in the sticky header? I've tried doing <code>left: 35%; position: relative;</code> to center it a bit more but it isn't fully centered. (The code is commented under <code>#navbar a</code> in the CSS section.)</p>
  
  <p>Thank you for your help!</p>
  
  <p>My code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>/* Navbar */
  .logo {
    height: 10%;
    width: 15%;
    display: block;
    margin-left: auto;
    margin-right: auto;
  }
  
  #navbar {
    overflow: hidden;
    background-color: #333;
  }
  
  #navbar a {
    margin-left: auto;
    margin-right: auto;
    color: gold;
    font-family: "League Spartan";
    text-transform: uppercase;
    float: left;
    display: block;
    padding: 2rem;
    /* left: 35%;
    position: relative; */
  }
  
  #navbar a:hover {
    color: black;
    background-color: #ddd;
  }
  
  .content {
    padding: 16px;
  }
  
  .sticky {
    position: fixed;
    top: 0;
    width: 100%;
  }
  
  .sticky + .content {
    padding-top: 60px;
  }
  
  /* Slideshow */
  .slideshow-container {
    max-width: 1000px;
    position: relative;
    margin: auto;
  }
  
  .mySlides {
    display: none;
  }
  
  .prev,
  .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    margin-top: -22px;
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
  }
  
  .next {
    right: 0;
    border-radius: 3px 0 0 3px;
  }
  
  .prev:hover,
  .next:hover {
    background-color: rgba(0, 0, 0, 0.8);
  }
  
  .text {
    color: #f2f2f2;
    font-family: "League Spartan";
    font-size: 15px;
    text-transform: uppercase;
    padding: 8px 12px;
    position: absolute;
    bottom: 8px;
    width: 100%;
    text-align: center;
  }
  
  .numbertext {
    color: #f2f2f2;
    font-family: "League Spartan";
    font-size: 12px;
    padding: 8px 12px;
    position: absolute;
    top: 0;
  }
  
  .dot {
    cursor: pointer;
    height: 15px;
    width: 15px;
    margin: 0 2px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
  }
  
  .active,
  .dot:hover {
    background-color: #717171;
  }
  
  .fade {
    -webkit-animation-name: fade;
    -webkit-animation-duration: 1.5s;
    animation-name: fade;
    animation-duration: 1.5s;
  }
  
  @-webkit-keyframes fade {
    from {
      opacity: 0.4;
    }
    to {
      opacity: 1;
    }
  }
  
  @keyframes fade {
    from {
      opacity: 0.4;
    }
    to {
      opacity: 1;
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!-- Navbar --&gt;
      &lt;nav&gt;
        &lt;div id="navbar"&gt;
          &lt;a href="#about-us"&gt;About Us&lt;/a&gt;
          &lt;a href="#prices"&gt;Prices&lt;/a&gt;
          &lt;a href="#now-showing"&gt;Now Showing&lt;/a&gt;
        &lt;/div&gt;
      &lt;/nav&gt;
  
      &lt;!-- Slideshow --&gt;
      &lt;br&gt;
      &lt;div class="slideshow-container"&gt;
        &lt;div class="mySlides fade"&gt;
          &lt;div class="numbertext"&gt;1 / 3&lt;/div&gt;
          &lt;img src="../../media/people-at-the-cinema.jpg" style="width: 100%"&gt;
          &lt;div class="text"&gt;We Have Renovated!&lt;/div&gt;
        &lt;/div&gt;
  
        &lt;div class="mySlides fade"&gt;
          &lt;div class="numbertext"&gt;2 / 3&lt;/div&gt;
          &lt;img src="../../media/playmobil-poster.jpg" style="width: 100%"&gt;
          &lt;div class="text"&gt;In Cinemas August 9&lt;/div&gt;
        &lt;/div&gt;
  
        &lt;div class="mySlides fade"&gt;
          &lt;div class="numbertext"&gt;3 / 3&lt;/div&gt;
          &lt;img src="../../media/frozen-2-poster.jpg" style="width: 100%"&gt;
          &lt;div class="text"&gt;In Cinemas November 22&lt;/div&gt;
        &lt;/div&gt;
  
        &lt;!-- Next and previous buttons --&gt;
        &lt;a class="prev" onclick="plusSlides(-1)"&gt;&amp;#10094;&lt;/a&gt;
        &lt;a class="next" onclick="plusSlides(1)"&gt;&amp;#10095;&lt;/a&gt;
      &lt;/div&gt;
      &lt;br&gt;
  
      &lt;!-- The dots/circles --&gt;
      &lt;div style="text-align:center"&gt;
        &lt;span class="dot" onclick="currentSlide(1)"&gt;&lt;/span&gt;
        &lt;span class="dot" onclick="currentSlide(2)"&gt;&lt;/span&gt;
        &lt;span class="dot" onclick="currentSlide(3)"&gt;&lt;/span&gt;
      &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>