title: How can i center the arrows on a slideshow? leaving a100px of distance between both and staying in the same place with different widths
body: <p>The arrows are centered horizontally and vertically, but i want them centered horizontally with 100px of distance between prev and next arrows.
  So they won't be sticked to the edge of the window.</p>
  
  <p>I have tried to add the arrows on a div and then center them horizontally and vertically but can't make it work.</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-js lang-js prettyprint-override"><code>(function() {
  
    init(); //on page load - show first slide, hidethe rest
  
    function init() {
  
      parents = document.getElementsByClassName('slideshow-container');
  
      for (j = 0; j &lt; parents.length; j++) {
        var slides = parents[j].getElementsByClassName("mySlides");
        var dots = parents[j].getElementsByClassName("dot");
        slides[0].classList.add('active-slide');
        dots[0].classList.add('active');
      }
    }
  
    dots = document.getElementsByClassName('dot'); //dots functionality
  
    for (i = 0; i &lt; dots.length; i++) {
  
      dots[i].onclick = function() {
  
        slides = this.parentNode.parentNode.getElementsByClassName("mySlides");
  
        for (j = 0; j &lt; this.parentNode.children.length; j++) {
          this.parentNode.children[j].classList.remove('active');
          slides[j].classList.remove('active-slide');
          if (this.parentNode.children[j] == this) {
            index = j;
          }
        }
        this.classList.add('active');
        slides[index].classList.add('active-slide');
  
      }
    }
    //prev/next functionality
    links = document.querySelectorAll('.slideshow-container a');
  
    for (i = 0; i &lt; links.length; i++) {
      links[i].onclick = function() {
        current = this.parentNode;
  
        var slides = current.getElementsByClassName("mySlides");
        var dots = current.getElementsByClassName("dot");
        curr_slide = current.getElementsByClassName('active-slide')[0];
        curr_dot = current.getElementsByClassName('active')[0];
        curr_slide.classList.remove('active-slide');
        curr_dot.classList.remove('active');
        if (this.className == 'next') {
  
          if (curr_slide.nextElementSibling.classList.contains('mySlides')) {
            curr_slide.nextElementSibling.classList.add('active-slide');
            curr_dot.nextElementSibling.classList.add('active');
          } else {
            slides[0].classList.add('active-slide');
            dots[0].classList.add('active');
          }
  
        }
  
        if (this.className == 'prev') {
  
          if (curr_slide.previousElementSibling) {
            curr_slide.previousElementSibling.classList.add('active-slide');
            curr_dot.previousElementSibling.classList.add('active');
          } else {
            slides[slides.length - 1].classList.add('active-slide');
            dots[slides.length - 1].classList.add('active');
          }
  
        }
  
      }
  
    }
  })();</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>/* Slideshow container */
  
  .slideshow-container {
    max-width: 1000px;
    position: relative;
    margin: auto;
  }
  
  
  /* Next &amp; previous buttons */
  
  .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;
  }
  
  
  /* Position the "next button" to the right */
  
  .next {
    right: 0;
    border-radius: 3px 0 0 3px;
  }
  
  
  /* On hover, add a black background color with a little bit see-through */
  
  .prev:hover,
  .next:hover {
    background-color: rgba(0, 0, 0, 0.8);
  }
  
  
  /* Caption text */
  
  .text {
    color: #f2f2f2;
    font-size: 15px;
    padding: 8px 12px;
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
  }
  
  .mySlides {
    display: none;
  }
  
  .active-slide {
    display: block;
  }
  
  
  /* Number text (1/3 etc) */
  
  .numbertext {
    color: #f2f2f2;
    font-size: 12px;
    padding: 8px 12px;
    position: absolute;
    top: 0;
  }
  
  
  /* The dots/bullets/indicators */
  
  .dot {
    cursor: pointer;
    height: 13px;
    width: 13px;
    margin: 0 2px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
  }
  
  .active,
  .dot:hover {
    background-color: #717171;
  }
  
  
  /* Fading animation */
  
  .fade {
    -webkit-animation-name: fade;
    -webkit-animation-duration: 1.5s;
    animation-name: fade;
    animation-duration: 1.5s;
  }
  
  @-webkit-keyframes fade {
    from {
      opacity: .4
    }
    to {
      opacity: 1
    }
  }
  
  @keyframes fade {
    from {
      opacity: .4
    }
    to {
      opacity: 1
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
  &lt;head&gt;
    &lt;script src="/scripts/snippet-javascript-console.min.js?v=1"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;div class="slideshow-container"&gt;
      &lt;div class="mySlides fade"&gt;
        &lt;div class="numbertext"&gt;1 / 4&lt;/div&gt;
        &lt;img src="http://www.w3schools.com/howto/img_mountains_wide.jpg" style="width:100%"&gt;
        &lt;div class="text"&gt;Caption Text&lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="mySlides fade"&gt;
        &lt;div class="numbertext"&gt;2 / 4&lt;/div&gt;
        &lt;img src="http://www.w3schools.com/howto/img_fjords_wide.jpg" style="width:100%"&gt;
        &lt;div class="text"&gt;Caption Two&lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="mySlides fade"&gt;
        &lt;div class="numbertext"&gt;3 / 4&lt;/div&gt;
        &lt;img src="http://www.w3schools.com/howto/img_nature_wide.jpg" style="width:100%"&gt;
        &lt;div class="text"&gt;Caption Three&lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="mySlides fade"&gt;
        &lt;div class="numbertext"&gt;4 / 4&lt;/div&gt;
        &lt;img src="http://placehold.it/1000x350" style="width:100%"&gt;
        &lt;div class="text"&gt;Caption Four&lt;/div&gt;
      &lt;/div&gt;
  
      &lt;a class="prev"&gt;&amp;#10094;&lt;/a&gt;
      &lt;a class="next"&gt;&amp;#10095;&lt;/a&gt;
  
      &lt;div style="text-align:center"&gt;
        &lt;span class="dot"&gt;&lt;/span&gt;
        &lt;span class="dot"&gt;&lt;/span&gt;
        &lt;span class="dot"&gt;&lt;/span&gt;
        &lt;span class="dot"&gt;&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&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="http://www.w3schools.com/howto/img_mountains_wide.jpg" style="width:100%"&gt;
        &lt;div class="text"&gt;Caption Text&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="http://www.w3schools.com/howto/img_fjords_wide.jpg" style="width:100%"&gt;
        &lt;div class="text"&gt;Caption Two&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="http://www.w3schools.com/howto/img_nature_wide.jpg" style="width:100%"&gt;
        &lt;div class="text"&gt;Caption Three&lt;/div&gt;
      &lt;/div&gt;
  
      &lt;a class="prev"&gt;&amp;#10094;&lt;/a&gt;
      &lt;a class="next"&gt;&amp;#10095;&lt;/a&gt;
      &lt;div style="text-align:center"&gt;
        &lt;span class="dot"&gt;&lt;/span&gt;
        &lt;span class="dot"&gt;&lt;/span&gt;
        &lt;span class="dot"&gt;&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
  
    &lt;br&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>