title: Make controls be inside of my slideshow and stuck always at same position
body: <p>I´ve been getting problems with the controls of my slideshow, i cant make the slideshow controls/navigation stuck at the bottom of the slideshow but inside the slideshow, the controls should always be at same position no matter the window size.</p>
  
  <p>How you will see at the moment the controls outside the images and they will change position if i resize the window.</p>
  
  <p>Site live: <a href="http://optential.co.nf/" rel="nofollow">http://optential.co.nf/</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var seconds = 2; //time beetwen auto slide
  var delay = 8; //time to restart auto slide
  
  var slider = $('#slider');
  var images = $('#slider .images');
  var controls = $('&lt;div&gt;').addClass('controls');
  slider.after(controls);
  var width = images.width();
  var slideClick = function () {  
    var b = $(this);
    $('.controls div').removeClass('current');
    b.addClass('current');
    var index = b.index();
    images.css('left', -1 * index * width);
  };
  $('#slider .images img').each(function (i) {
    var img = $(this);
    img.css('left', i * width);
    var button = $('&lt;div&gt;');
    controls.append(button);
    if (i == 0) { button.addClass('current') }
    button.click(function(){
      clearInterval(autoSlideInterval);
      slideClick.apply(this);
      setTimeout(function () {
         setInterval(autoSlide, seconds * 1000);     
      }, delay * 1000);
    });
  });
  var autoSlide = function(){
    var next = $('.controls .current').next();
    if (next.length) {
      slideClick.apply(next); 
    } else {
      var first = $('.controls div').first();
      slideClick.apply(first); 
    }
  };
  var autoSlideInterval = setInterval(autoSlide, seconds * 1000);</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>html,
  body { height: 100%; }
  
  body {
    margin: 0;
    font-family: 'Open Sans', Helvetica, sans-serif;
    min-width: 900px;
  }
  
  .header {
    background-image: url("img/fundo1.jpg");
    background-color: rgb(21, 21, 21);
    background-size: cover;
    color: white;
    height: 100%;
    min-height: 650px;
    position: relative;
  }
  
  .header .logo {
    width: 230px;
    height: 60px;
    margin: 20px 8px 8px 6%;
  }
  
  .header .menu {
    position: absolute;
    top: 55px; right: 25px;
  }
  
  .header .menu a {
    margin: 0 4px;
    font-size: 15px;
    color: white;
    text-decoration: none;
    padding: 6px 20px;
  }
  
  .header .menu a:hover,
  .header .menu a.current {
    color: rgb(204, 66, 63);
  }
  
  .header .move {
    color: white;
    width: 40%;
    margin: 0;
    padding: 10px;
  }
  
  .header .move .center {
    margin: 260px auto 0;
    width: 360px;
  }
  
  .header .move h1 {
    font-weight: 400;
    font-size: 38px;
    margin: 6px 0;
  }
  
  .header .move p {
    font-weight: 300;
    font-size: 20px;
    border-top: 2px solid white;
    margin: 6px 0;
    padding-top: 6px;
  }
  
  .header .mail1 {
    background-image: url("img/email.png");
    background-size: contain;
    background-position: 100% 100%;
    background-repeat: no-repeat;
    width: 560px; height: 560px;
    position: absolute;
    bottom: 0; right: 0;
  }
  
  .header .mail1 form {
    position: absolute;
    width: 240px;
    bottom: 220px; right: 155px;
  }
  
  .header .mail1 h1 {
    font-weight: 300;
    text-align: center;
    color: rgb(203, 41, 37);
  
  }
  .header .mail1 input {
    box-sizing: border-box;
    width: 100%;
    font-family: 'Open Sans', Helvetica, sans-serif;
    padding: 8px;
    border: 1px solid rgb(219, 219, 218);
    border-radius: 6px;
    margin-bottom: 12px;
   }
  
  .header .mail1 input:hover {
    border: 1px solid rgb(189, 189, 188);
  }
  
  .header .mail1 input:focus {
    outline: 0;
  }
  
  .header .mail1 a {
    display: block;
    color: white;
    text-decoration: none;
    background-color: rgb(204, 66, 63);
    border-radius: 6px;
    text-align: center;
    padding: 8px;
    font-size: 14px;
  }
  
  .header .mail1 a:hover {
    background-color: rgb(224, 86, 83);
  }
  
  .mail2 {
    box-shadow: 10px 6px 15px grey;
    background-color: white;
    background-image: url("img/barra.png");
    background-position: 12% 0%;
    height: 100px;
    background-repeat: no-repeat;
    text-align: right;
  }
  
  #btn {
      width: 10em; 
    }
  
  .mail2.fixed {
    box-shadow: 10px 6px 15px grey;
    position: fixed;
    display:block;
    top: 0; left: 0;
    width: 100%;
    min-width: 800px;
    height: 100px;
    z-index: 1;
  }
  
  .mail2 form {
    display: inline-block;
    margin: 30px 0;
    padding: 0 10px;
    width: 600px;
  }
  
  .mail2 h1 {
    font-weight: 300;
    color: rgb(203, 41, 37);
    display: inline;
    vertical-align: middle;
    font-size: 28px;
  }
  
  .mail2 input {
    box-sizing: border-box;
    width: 220px;
    font-family: 'Open Sans', Helvetica, sans-serif;
    padding: 8px;
    border: 1px solid rgb(219, 219, 218);
    border-radius: 6px;
    margin: 0 6px;
  }
  
  .mail2 input:hover {
    border: 1px solid rgb(189, 189, 188);
  }
  
  .mail2 input:focus {
    outline: 0;
  }
  
  .mail2 a {
    display: inline;
    color: white;
    text-decoration: none;
    background-color: rgb(204, 66, 63);
    border-radius: 6px;
    text-align: center;
    padding: 8px 4%;
    font-size: 14px;
  }
  
  .mail2 a:hover {
    background-color: rgb(224, 86, 83);
  }
  
  .mail2 .top {
    padding: 8px 6px;
    background-color: rgb(51, 51, 51);
  }
  
  .mail2 .top:hover {
    background-color: rgb(71, 71, 71);
  }
  
  #slider {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }
  
  #slider .images { 
    width: 100%;
    position: relative;
    transition: left 1s;
    left: 0;
  }
  
  #slider .images img {
    z-index: -1;
    width: 100%;
    background-size: 100%;
    position: absolute;
  }
  
  .controls {
    width: 350px;
    margin: 5px auto;
    display: flex;
    justify-content: center;
  }
  
  .controls div {
  
    width: 16px;
    height: 16px;
    margin: 0 5px;
    background: tomato;
    border-radius: 50%;
  }
  
  .controls .current {
    background: red;
  }
  
  .mobile {
    min-width: 1300px;
  }
  
  .mobile .bar {
    background-size: cover;
    width: 100%;
    background: #F4F4F4;
    color: #595B61;
    min-width: 700px;
    display: flex;
    justify-content: space-around;
    text-align: center;
  }
  
  .mobile .bar img {
    width: 100%;
    background-size: cover;
    display: block;
    margin: 0 auto;
  }
  
  .mobile .content {
    background: radial-gradient(ellipse at 55% 50%, #F9F9F9 40%,#B6B5BD 120%);
    position: relative;
  }
  
  .mobile .content .mobimg {
    padding: 3em;
    margin-left:10%;
  }
  
  .mobile .content .mob {  
    position: absolute;  
    top: 0;
    left: 60%;
  }
  
  .mobile .content h1 {
    color: #D6D6D4;
    font-size: 120px;
    margin-bottom: 0;
  }
  
  .mobile .content p {
    margin-left: 15px;
    width: 410px;
    color: #929584;
    font-size: 12px;
    margin-bottom: 18px
  }
  
  .mobile .content .sep {
    height: 15px;
    border-bottom: 1px solid #C24147;
    text-align: center;
  }
  
  .mobile .content .sep img {
    padding: 0 8px;
    background: #F9F9F9;
  }
  
  .mobile .content h2 {
    margin-left: 15px;
    color: #929584;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
  }
  
  .mobile .content .buttons {
    display: flex;
    justify-content: space-around;
    width: 400px;
    margin-left: 20px;
  }
  
  .mobile .content .button {
    display: block;
    background: #010101;
    color: #F8F8F8;
    text-decoration: none;
    width: 160px;
    height: 50px;
    border-radius: 6px;
    position: relative;
  }
  
  .mobile .content .button:hover {
    background: #222;
  }
  
  .mobile .content .button.apple img {
    margin: 10px 0 0 10px;
  }
  
  .mobile .content .button.apple span {
    font-size: 11px;
    font-weight: 400;
    position: absolute;
    top: 4px; left: 42px;
  }
  
  .mobile .content .button.apple h3 {
    font-size: 22px;
    font-weight: 600;
    position: absolute;
    top: 14px; left: 42px;
    margin: 0;
  }
  
  .mobile .content .button.google img {
    margin: 18px 0 0 8px;
  }
  
  .mobile .content .button.google span {
    font-size: 10px;
    font-weight: 600;
    position: absolute;
    top: 4px; left: 40px;
    text-transform: uppercase;
  }
  
  .mobile .content .button.google h3 {
    font-size: 20px;
    font-weight: 300;
    position: absolute;
    top: 16px; left: 38px;
    margin: 0;
  }
  
  .mobile .content .button.google h3 b {
    font-size: 22px;
    font-weight: 400;
    font-family: 'Cardo', serif;
    margin: 0;
    margin-right: 4px
  }
  
  .contact {
    min-width: 1100px;
    background-image: url("img/fundo2es.jpg");
    background-size: cover;
    background-color: rgb(21, 21, 21);
    background-repeat: no-repeat;
    height:100%;
    color:white;
  }
  
  .contact .textocon {
    text-align: right;
    padding: 55px 75px 0 0;
  }
  
  .contact .textocon div {
    display: inline-block;
    width: 290px
  }
  
  .contact .textocon h1 {
    font-weight: 400;
    font-size: 42px;
    margin: 6px 0;
  }
  
  .contact .textocon p {
    font-weight: 300;
    font-size: 19px;
    border-top: 2px solid white;
    margin: 6px 0;
    padding-top: 6px;
  }
  
  .contact .col1 {
    display: inline-block;
    vertical-align: top;
    width: 410px;
    padding: 10px 6px 10px 60px;
  }
  
  .contact .col1 h1 {
    font-weight: 300;
    font-size: 25px;
    margin: 4px 0;
  }
  
  .contact .col1 input {
    width: 380px;
    height: 20px;
  }
  
  .contact .col1 input,
  .contact .col2 textarea {
    font-family: 'Open Sans', Helvetica, sans-serif;
    padding: 14px;
    font-size: 13px;
    color: white;
    background-color: transparent;
    border: 1px solid rgb(172, 161, 160);
    margin: 6px 0;
  }
  .contact .col1 input:focus,
  .contact .col2 textarea:focus {
    outline: 0;
    border: 1px solid white;
  }
  
  .contact .col2 {
    display: inline-block;
    width: calc(100% - 560px);
    padding: 52px 10px 10px 0;
    text-align: right;
  }
  
  .contact .col2 textarea {
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    height: 112px;
  }
  
  .contact .col2 #btn {
    display: inline-block;
    color: white;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    background-color: rgb(204, 66, 63);
    border-radius: 4px;
    padding: 10px 0px;
    font-size: 20px;
  }
  .contact .col2 a:hover {
    background-color: rgb(224, 86, 83);
  }
  
  .contact .info {
    padding: 10px 60px;
    display: flex;
    justify-content: space-between;
  }
  
  .contact .info h1 {
    font-weight: 300;
    font-size: 25px;
  }
  
  .contact .info p {
    font-size: 12px;
    line-height: 12px;
  }
  
  .contact .info a {
    text-decoration: none;
    color: white;
  }
  .contact .info a:hover {
    color: #ddd;
  }
  
  .contact .info img {
    width: 32px;
    margin: 6px;
  }
  .contact .info img:hover {
    opacity: 0.8;
  }</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="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script src="js/fixedbar.js"&gt;&lt;/script&gt;
      &lt;script src="js/slider.js"&gt;&lt;/script&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300" rel="stylesheet" type="text/css"&gt;
      &lt;link href="styles.css" rel="stylesheet" type="text/css"&gt;
      &lt;title&gt; Layout &lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
  
  
      &lt;div class="header" id="top"&gt;
        &lt;img class="logo" src="img/logo.png"&gt;
        &lt;div class="menu"&gt;
          &lt;a href="#" class="current"&gt;Home&lt;/a&gt;
          &lt;a href="#tour"&gt;Product Tour&lt;/a&gt;
          &lt;a href="#"&gt;Pricing&lt;/a&gt;
          &lt;a href="#"&gt;Try&lt;/a&gt;
          &lt;a href="#vision"&gt;Vision&lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="move"&gt;
          &lt;div class="center"&gt;
            &lt;h1&gt;Move work forward!&lt;/h1&gt;
            &lt;p&gt;Optential keeps your team organized, connected, and focused on results.&lt;/p&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="mail1"&gt;
          &lt;form action="form/form.php" method="post"&gt;
            &lt;h1&gt;Try Now!&lt;/h1&gt;
            &lt;input name="Email" class="Email" type="text" placeholder="Enter your Email address ..."&gt;
            &lt;input type="submit" value="Get started for free"&gt;
          &lt;/form&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="mail2"&gt;
          &lt;form action="form/form.php" method="post"&gt;
          &lt;h1&gt;Try Now!&lt;/h1&gt;
          &lt;input type="text" placeholder="Your Email here..."&gt;
          &lt;input type="submit" id ="btn" value="Get started for free"&gt;
          &lt;a class="top" href="#top"&gt;Top&lt;/a&gt;
        &lt;/form&gt;
      &lt;/div&gt;
  
  
      &lt;div id="slider"&gt;
          &lt;div class="images"&gt;
            &lt;div class="controls"&gt;
            &lt;img src="img/3.png" alt="Image-1" /&gt;
            &lt;img src="img/2.png" alt="Image-2" /&gt;
            &lt;img src="img/1.png" alt="Image-3" /&gt;
            &lt;img src="img/4.png" alt="Image-4" /&gt;
          &lt;/div&gt; 
        &lt;/div&gt;
      &lt;/div&gt;
  
       &lt;div class="mobile"&gt;
        &lt;div class="bar"&gt;
          &lt;img src="img/barra2.png"&gt;
        &lt;/div&gt;
        &lt;div class="content"&gt;
          &lt;img class="mobimg" src="https://jsbin-user-assets.s3.amazonaws.com/rafaelcastrocouto/mob.png"&gt;
          &lt;div class="mob"&gt;
            &lt;h1&gt;Mobile&lt;/h1&gt;
            &lt;p&gt;Optential combines the best of responsive software with native IOS and Android apps to provide the best experience and optimal results!&lt;/p&gt;
            &lt;p&gt;On laptops, desktops, tablets and phones, always get the best experience on the most intuitive project management set of tools in the world!&lt;/p&gt;
            &lt;p class="sep"&gt;
              &lt;img src="https://jsbin-user-assets.s3.amazonaws.com/rafaelcastrocouto/a1.png"&gt;
            &lt;/p&gt;
            &lt;h2&gt;Coming soon !&lt;/h2&gt;
          
        &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="contact"&gt;
        &lt;div class="textocon"&gt;
          &lt;div&gt;
            &lt;h1&gt;Optential&lt;/h1&gt;
            &lt;p&gt;A new management system&lt;br&gt;for a new management paradigm!&lt;/p&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;form method="POST" id="contactos_form" action="form/contactengine.php" onsubmit="return submit_form(this);"&gt;
          &lt;div class="col1"&gt;
            &lt;h1&gt;Contact us!&lt;/h1&gt;
            &lt;input type="text" name="Name" size="50" placeholder="Name"/&gt;
            &lt;input type="text" name="Email" size="50" placeholder="Email"/&gt;
            &lt;input type="text" name="Subject" size="50" placeholder="Subject"/&gt;
          &lt;/div&gt;
          &lt;div class="col2"&gt;
            &lt;textarea name="Message" rows="5" cols="70" placeholder="Message..."&gt;&lt;/textarea&gt;
            &lt;input type="submit" id="btn"value="Send"/&gt;
          &lt;/div&gt;
        &lt;/form&gt;
        &lt;div class="info"&gt;
          &lt;div&gt;
            &lt;h1&gt;Mail Us !&lt;/h1&gt;
            &lt;p&gt;Rua Andrade Corvo, 242&lt;/p&gt;
            &lt;p&gt;sala 206&lt;/p&gt;
            &lt;p&gt;4700-204 Braga&lt;/p&gt;
            &lt;p&gt;Portugal&lt;/p&gt;
          &lt;/div&gt;
          &lt;div&gt;
            &lt;h1&gt;Call Us !&lt;/h1&gt;
            &lt;a href="#"&gt;&lt;p&gt;+351 987654323&lt;/p&gt;&lt;/a&gt;
            &lt;a href="#"&gt;&lt;p&gt;+351 987654323&lt;/p&gt;&lt;/a&gt;
            &lt;a href="#"&gt;&lt;p&gt;+351 987654323&lt;/p&gt;&lt;/a&gt;
          &lt;/div&gt;
          &lt;div&gt;
            &lt;h1&gt;Email Us! &lt;/h1&gt;
            &lt;a href="#"&gt;&lt;p&gt;code@angel.com&lt;/p&gt;&lt;/a&gt;
            &lt;a href="#"&gt;&lt;p&gt;code_hr@angel.com&lt;/p&gt;&lt;/a&gt;
            &lt;a href="#"&gt;&lt;p&gt;code_support@angel.com&lt;/p&gt;&lt;/a&gt;
          &lt;/div&gt;
          &lt;div&gt;
            &lt;h1&gt;Join Us! &lt;/h1&gt;
            &lt;a href="#"&gt;&lt;img src="img/facebook.png"&gt;&lt;/a&gt;
            &lt;a href="#"&gt;&lt;img src="img/gplus.png"&gt;&lt;/a&gt;
            &lt;a href="#"&gt;&lt;img src="img/twitter.png"&gt;&lt;/a&gt;
            &lt;a href="#"&gt;&lt;img src="img/instag.png"&gt;&lt;/a&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  &lt;script src="js/slider.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  function submit_form(form){
    formulario=$("#contactos_form");
  
     $.ajax({url: formulario.attr("action"), method:formulario.attr("method"), data:formulario.serialize(), success: function(result){
          alert(result);
      }});
  
  
    return false;
  }
  
  
  &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The css of the slideshow is "slider" and "controls".</p>
  
  <p>TL:DR: How can i make the controls of the slideshow be inside of it, close of the bottom and dont change position when we resize the window.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div id="slider"&gt;
      &lt;div class="controls"&gt;
        &lt;img src="img/3.png" alt="Image-1" /&gt;
        &lt;img src="img/2.png" alt="Image-2" /&gt;
        &lt;img src="img/1.png" alt="Image-3" /&gt;
        &lt;img src="img/4.png" alt="Image-4" /&gt;
      &lt;/div&gt; 
      &lt;div class="controls"&gt;&lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p><strong>CSS:</strong></p>
  
  <pre><code>    #slider {
    width: 100%;
      height: 100%;
      overflow: hidden;
      position: relative;
  }
  
  #slider .images .controls  { 
    width: 100%;
    height: 658px;
    position: relative;
    transition: left 1s;
    left: 0;
  }
  
  #slider .images img {
    z-index: -1;
    width: 100%;
    background-size: 100%;
    position: absolute;
  }
  
  .controls {
    width: 100%;
      display: flex;
      position: absolute;
      justify-content: center;
      top: 80%;
  }
  
  .controls div {
  
    width: 16px;
    height: 16px;
    margin: 0 5px;
    background: tomato;
    border-radius: 50%;
  }
  
  .controls .current {
    background: red;
  }
  </code></pre>